Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo
I am using PyDev 2.3.0 in Eclipse 3.7.1 on Ubuntu 11.10.
When I import a file system directory into a source folder, the PyDev hover functionality cannot resolve modules etc. in the iported directory if I have chosen "Create links in workspace" in the import dialog (hover gives error __module_not_in_the_pythonpath__).
If I however do not choose "Create links in workspace" in the import dialog, hover resolves correctly.
Is this a bug, or is there a way to fix this so that hover resolves correctly also when code is imported and linked from the worspace?
It only works if set the same folder you used to create the link as a source folder (otherwise this is expected: PyDev doesn't support links in other places).
p.s.: if that doesn't work, please specify more details as paths/source folders so that I can give better advice on it.
I am not sure I quite follow you there Fabio, but let me explain more exactly the setup:
I have an Eclipse project at say ~/proj/test_workspace/
I then have soure code at say /opt/program1/src
What I would like to do is to create a source folder in the above Eclipse project, import the source code from /opt/program1/src and leave the code at this /opt/… location. That is why I clicked "create links in workspace".
Are you saying this scheme is not supported by the PyDev Hover resolver?
You can do that provided you do the following:
Let's say you have your workspace at:
And create a new project in eclipse at:
And want to have the sources for that project at:
For that to work you must have
~/proj/test_workspace/program1/src mapping to folder link at /opt/program1/src (created through: right click project > new > folder > advanced > link to alternate location).
And ~/proj/test_workspace/program1/src must be the source folder set in: right click project > properties > pydev - pythonpath.
This should work properly (note that alternatively you could also just create your project directly at /opt/program1 instead of creating a project inside the eclipse workspace with a link to the sources - just set the proper location on the wizard to create a new pydev project).
and thank you for the reply.
I tested what you suggested, and it worked fine if you put the exact (leaf) source folder into the python path. The problem is however that under the /opt/program1/src directory there is a big tree of source code subdirectories. It seems the name resolution does not work for the subdirectories under the directory chosen in the project pythonpath source folder list.
It would be nice to be able to select /opt/program1/src/* but that is currently not possible to achieve somehow?
It is possible to use that existing location directly in PyDev. See: http://pydev.org/faq.html#how_do_i_import_existing_projects_sources_into_pyd