PyDev Eclipse Python interpreters Error: stdlib not found

前端 未结 12 1192
太阳男子
太阳男子 2021-02-02 10:24

I have been trying to use Eclipse 3.6 as a Python editor. I install the latest version of PyDev, and then try to set the Interpreter - Python field of the preferences, on my ma

相关标签:
12条回答
  • 2021-02-02 10:56

    Had the same problem. Eclipse wouldn't find all the required path using the default installed python (2.6). I downloaded python 2.7, went through the install. My new "which python" path became:

    /Library/Frameworks/Python.framework/Versions/2.7/bin/python.

    When I tried to set up the interpreter this time, specified this path and it went right through.

    Note:

    1. Browse to /Library/Frameworks/Python.framework/Versions/2.7/bin directory
    2. Select the python interpreter that's installed. Sometimes the 'python' link doesn't exist to the current interpreter (say, python3)
    0 讨论(0)
  • PyDev needs the location of the python lib folder to get this directory location on your computer try running this command in the terminal.

    python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())"
    

    And add that directory to your PYTHONPATH location in PyDev in Eclipse.

    0 讨论(0)
  • 2021-02-02 10:57

    In Preferences > PyDev > Interpreter - Python

    • Choose New...
    • Name it "Python2.7"
    • set the path to /usr/bin/python

    it then auto-configs some paths, select them, and it proceeds.

    0 讨论(0)
  • 2021-02-02 10:58

    I decided to leave my MAC OS Python 2.7 as is, and instead just install Python 3.3.4. It works smoothly! :)

    1) download python 3.3.4:

    The python-3.3.4-macosx10.6.dmg is from http://python.org/download/releases/3.3.4/: downloaded "from Mac OS X 64-bit/32-bit Installer (3.3.4) for Mac OS X 10.6 and later" (My Mac OS is Mountain Lion).

    2) setup Python Interpreter and Lib:

    Go to Eclipse Preferences > Interpreter > Python Interpreter and click "Quick Auto Config". It is able to locate the Python 3.3.4, find the interpreter as /usr/local/bin/python3 (which is actually: shulow$ ls -l /usr/local/bin/python3 lrwxr-xr-x 1 root wheel 69 4 Mar 23:18 /usr/local/bin/python3 -> ../../../Library/Frameworks/Python.framework/Versions/3.3/bin/python3)

    And it also automatically find the respective libraries in /Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3 which has the .py files (rather than only the .pyc and .pyo)

    0 讨论(0)
  • 2021-02-02 11:00

    For OS X 10.8 (Mountain Lion) I found a solution here: pydev debugger: unable to find real location for python 2.7 after OS 10.8 upgrade

    Seems that there are no command line tools installed by default, so you have to go download them...

    0 讨论(0)
  • 2021-02-02 11:00

    After installing Apple's OSX Developer tools from http://developer.apple.com/xcode/, the necessary .py files will be installed in /library/python/2.6/site-packages. No need to fuss with installing python yourself of using versions of Python not blessed by Apple.

    0 讨论(0)
提交回复
热议问题