Pydev unresolved import errors
June 12, 2009...... at 3:21 pm | Posted in geek | 37 CommentsFor those seeing a lot of Pydev unresolved import errors the problem is related to the fact that pydev doesn’t seem to register nested modules. So if your package contains a package which contains a module, unless the parents of both packages appears on the Pythonpath, pydev will hit you with an unresolved import error. To make it go away you have 2 choices:
1. Add the parent to the python path
2. Click Ctl + 1 and select Unresolved import error
37 Comments »
RSS feed for comments on this post. TrackBack URI
Leave a reply to Random Guy Cancel reply
Blog at WordPress.com.
Entries and comments feeds.
Thanx mate. That’s been a botherin’ me fer awhile now. If I upgrade my PyDev version would that help too? (I haven’t done it because I’m scared I’m going to have to pay for the upgrade!)..
(Eclipse Version: 3.4.1, PyDev version: 1.3.22).
Comment by Orfeus— June 19, 2009...... #
pydev is open source now, so you shouldn’t have to pay. The easiest way to turn it off is in the Eclipse Preferences “Pydev / Editor / Code Analysis”.
Comment by nicholas tung— December 12, 2009...... #
Cool trick! Thanks!
Comment by Jean-Lou Dupont— January 12, 2010...... #
Thanks. I spent hours re-installing and looking for configuration files. Following your advice 2 mins solved the problem
Comment by Alex Gallacher— October 1, 2010...... #
I added parent directory of both modules, but am still getting that error. What else could it be?
Comment by Igor Ganapolsky— May 26, 2010...... #
My problem went away by removing the default interpreter and adding it back again. It seems I upgraded Django and somehow it went away from the _builtins_.
Abhaya
Comment by Abhaya— June 6, 2010...... #
This worked for me. It was having issues with libs I’d installed after installing pydev. This fixed it.
Comment by Guy G— October 6, 2010...... #
Thanks for that too! This has been driving me mad for ages and Ctrl 1 did the trick.
Comment by pictiPig— July 14, 2010...... #
Great, this really helps!!!
Comment by chiptip— September 7, 2010...... #
in my case, I downloaded ‘Eclipse IDE for JavaScript Web Developers’ and did the following step: help menu->install new software.. then add ‘http://pydev.org/updates’. next is restart.
did this:
import random
number = random.randint(1, 10)
print(number)
I didnt have issue like: unresolved import errors which i encountered in Eclipse Classic 3.6.0.
Comment by Eric C— September 12, 2010...... #
Awesome find! This helped me out too.
Comment by getreal1— October 5, 2010...... #
None of this fixed anything and most was not even applicable – is this particular to, e.g., Windows? I have Eclipse Helios on OS X, and I installed the Aptana Eclipse plug-in version because at the PyDev download it said I needed that for django templates.
What I’ve gotten out of PyDev so far is endless unresolved import module errors regardless of any steps I take to turn them off, etc., making any project i do in PyDev just annoying, not worthwhile. My verdict on PyDev is I’ll avoid it, and hope there’s something better for Eclipse somewhere else. Meanwhile, I edit my Python code in BBEdit.
The EPIC for Perl is not half the hassle this crap is, frankly.
Comment by Marion Delgado— November 8, 2010...... #
same here, i did everything- but i am still getting unresolved imports. decided not to use pydev anymore. annoying
Comment by onur— December 1, 2010...... #
really nice, saved my time
Comment by nived— January 7, 2011...... #
The only thing for me that solved the issue was to completely delete (window->preferences->pydev->interpreter python->remove) and then adding it again with Auto Config.
Regards
Comment by Lpaq— January 21, 2011...... #
Hi, Guys, you are very perfect, 3X & 3Q.
Comment by Plutus Sutulp— August 31, 2011...... #
That did the trick, thanks!
Comment by Oliver— May 30, 2012...... #
That worked for me as well. Nothing else was of help.
Comment by Sergei G (@prudok)— February 22, 2013...... #
Nice!!! It worked, thank you very much
Comment by pachinsvMario— July 5, 2013...... #
Installed Pyro and Eclipse couldnt import it. I did the same thing as Lpaq and reloaded my workspace and it works now.
Comment by Mog— March 27, 2011...... #
I added the folder to “System PYTHONPATH” under the “Libraries” tab at (window->preferences->pydev->interpreter python) and my problem was resolved.
Comment by Jim— May 29, 2011...... #
This is the correct way… it worked lika a charm for me.
thanks!
Comment by Luis Sánchez (@luissanxez)— August 16, 2011...... #
What worked for me was to remove the PyDev interpreter from Eclipse and re-add it using auto config. Thanks for the post!
Comment by Random Guy— June 1, 2011...... #
Many thanks!
It worked 🙂
Comment by bentzy— March 21, 2012...... #
My solution is rather simple:
configure into Python Interpreters->Libraries
remove “C:\Python27\lib\site-packages”
then add “C:\Python27\Lib\site-packages”
all problem solved….
Comment by felixhao— December 16, 2012...... #
hi!,I really like your writing so a lot! percentage we be in contact extra about your post on AOL?
I require a specialist on this house to unravel
my problem. Maybe that’s you! Taking a look forward to look you.
Comment by http://Sizegeneticsreviewsguide.com/— January 7, 2013...... #
Thank you very much. Ctrl + 1 did the trick for me. I had a problem with : from scapy.all import IP,send
Comment by andutzunic— April 18, 2013...... #
REAL SOLUTION:
Project->Properties->PyDev – PYTHONPATH->Force restore internal info
Comment by asdf— April 23, 2013...... #
Hi,
Tried all the solutions in the comments and no luck, any suggestions or corrections to steps I took? I tried the following, Each time I restart eclipse and still shows the unresolved import error.
1)
remove “C:\Python27\lib\site-packages”
then add “C:\Python27\Lib\site-packages”
No go
2)
Remove the interpreter
(window->preferences->pydev->interpreter python->remove)
adding it again with Auto Config
No go
3)
window->preferences->pydev->interpreter python->libraries
Added:
c:\python27\Lib\site-packages\lxml
No go
4)
Project->Properties->PyDev – PYTHONPATH->Force restore internal info
No go
Comment by Steve— April 26, 2013...... #
[…] PyDev unresolved import issue solution […]
Pingback by How to have autocomplete for Panda3D on PyDev (Eclipse) | shig's development corner— June 29, 2013...... #
[…] PyDev unresolved import issue solution […]
Pingback by How to have autocomplete for Panda3D on PyDev (Eclipse) | shig's development corner— June 30, 2013...... #
adding ${GOOGLE_APP_ENGINE}/lib/webapp2-2.5.2 to the “External Libraries” worked for me.
App Engine SDK ver:1.8.2
Python version: 2.7
Comment by Sathish— July 21, 2013...... #
In my case the unresolved Python modules were located in sibling directories under the ‘src’ directory, which was in turn a top-level directory within the project directory. PyDev was able to resolve the modules once the src dir was explicitly added to the PYTHON_PATH in the project properties. Similarly, unresolved external dependencies were resolved by adding them to the python path via the external libraries tab, although it took some trial and error to identify the exactly ho much of the path to include in order to achieve this.
Comment by ShamballaJones— September 29, 2014...... #
Thanks for the posting. It does help me.
Comment by Ridwan Kurniawan— October 5, 2014...... #
Thank you, brother!
Comment by Jabu— May 25, 2015...... #
[…] Source: https://klaith.wordpress.com/2009/06/12/pydev-unresolved-import-errors/ […]
Pingback by Python:How do I handle an UnresolvedImport Eclipse (Python) – IT Sprite— October 13, 2015...... #
6u25s2804lwsxypm6oil
Comment by 9qlwz— August 1, 2017...... #