質問

I have read this, but it didn't work for me.

These are the steps I used:

  1. Right-click project1 > Properties > Project References > select project2R
  2. Right-click project1 > Properties > PyDev - PYTHONPATH > Add source folder, but project2 is not listed

If I add project2 manually to .pydevproject, it replaces project2\src with project1\src.

This is really driving me crazy.

役に立ちましたか?

解決

Just add the path to the folder containing any package you wish to use into your PYTHONPATH environment variable (create a new one if there isn't one already) and voilá!

For instance, suppose you have a package named "foo" in a directory "/path/to/project/src/foo". Simply append "/path/to/project/src" (note that I left "foo" out of the path because that's our package) to PYTHONPATH and then open an interpreter and try "import foo". This should work both on Windows and Linux too ;)

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top