Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse Pydev: 'Error: Python stdlib not found'

I am trying to add an interpreter (created using virtualenv) to PyDev but I get the following error:

It seems that the Python /Lib folder (which contains the standard library) was not found /selected during the instal process.

This folder (which contains files such as threading.py and traceback.py) is required for PyDev to function properly (and it must contain the actual source files, not only .pyc files) ...

Note that if this is a virtualenv install, the /Lib folder from the base install needs to be selected (unlike the site-packages which is optional)...

The problem is that there is no /lib folder under my default installation... I created the virtualenv with the 'no-site-packages' option... How can I solve? thanks!

like image 619
Umar Jamil Avatar asked Jul 07 '11 18:07

Umar Jamil


1 Answers

I've come across this myself before. When adding an interpreter created using virtualenv in PyDev, when it asks for the folders that need to be added to the SYSTEM pythonpath, I had to select
/usr/lib/python2.7
/usr/lib/python2.7/lib-tk
/usr/lib/python2.7/plat-linux2
See the screenshot for what I had to do. Here temp is my virtualenv.

enter image description here

Even though the system Python directory was added, PyDev did not pick up the global site packages, so you still achieve the "no-site-packages" effect. I'm assuming you would have to do something similar on Windows i.e. select all the folder in the "Select Needed" dialog, including the C:\Pythonx.x folder.

EDIT: I just tried it out with PyDev 2.3 on Eclipse Indigo (Arch Linux with virtualenv 1.7), and it seems that plat-linux2 does not need to be selected (not sure about lib-tk, but /usr/lib/python2.7 is definitely required). Thanks fijiaaron for pointing it out.

EDIT 2: Pydev 2.5 (and probably 2.6 too, from the docs) still requires the /Lib folder to function properly, though it now lets you ignore the "Python stdlib not found" dialog and add the interpreter anyway (but mentions that it still needs to be included later).

like image 59
Anshuman Bhaduri Avatar answered Oct 27 '22 07:10

Anshuman Bhaduri