I've been looking around for quite some time but I just can't find the answer. Similar questions relate to some tricky cases with third party libraries and all, but my situation seems to be textbook-simple. Nevertheless I can't figure out how this works.
I'm using Eclipse 3.5.2, Pydev 2.2.0, running on an Ubuntu 11.04 machine.
My case seems simple: I want to write a package as its own project, and then I want to write an application using this package in another project.
How should I setup pydev so that I can have this two projects "core" (the package) and "app" (which uses the core package), and from within "app" do:
import core
?
By "doesn't work", I mean that I get an "unresolved import: core", always.
Ideas?
Provided you have 2 projects with the PYTHONPATH properly set (through source folders), it should work just adding a project reference.
Maybe an example can help...
E.g.:
project1
project1/src <-- this should be set as the source folder
project1/src/core
project1/src/core/__init__.py
project2
project2/src <-- this should be set as the source folder
project2/src/app
project2/src/app/__init__.py
and then edit the project2 properties > project references and select 'project1' to be able to access the project1 from the project2.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With