I am using LiClipse on OSX and trying to run django application using the Eclipse run configuration (this manages the virtualenv?). The app is not of my creation but works in production so I assume it is my environment that needs corrected. The app is structured as:
PyDev Project Folder
--manage.py
--requirements.txt
--django-app-folder
-----config-folder
--------__ini__.py
--------settings.py
--------evniroments.py
--------urls.py
--------wsgi.py
-----app-folder
--------__ini__.py
--------lots of other stuff
When I try to run the application it fails to import a module:
This appears to be fairly common, at least there a several other questions that are comparable and many dated ones such as: Eclipse + PyDev ImportError and ImportError: cannot import name... but they do not answer the question of how to configure the Eclipse run correctly for PyDev?
I have followed the docs at PyDev and the guidance in the referenced SO links such as removing the interpreter settings from PyDev and then adding it back and "Check if interpreters are synchronized with environment".
Here is the PYTHONPATH for the run config I am using:
And the interpreter settings under PyDev preferences - I have tried both the egg and the folder as well as each on their own:
There something strange in your PYTHONPATH: you have a django_filters_xxx.egg entry and a django_filters_xxx.egg/filters entry, which seems odd... is the .egg a folder or a zip in your case?
Does it work in the command line? If it works in the command line, you can try adding:
on the command line and comparing with the one in PyDev to check if there's something wrong there.
Another common issue is that sometimes you are shadowing the import with a module with the same name in your project.