Adding python modules to pydev in eclipse results in import error?

前端 未结 11 2128
难免孤独
难免孤独 2020-12-14 03:01

I have a problem getting PyDev on eclipse to recognize already installed modules. Here is my detailed approach. The machine is a Mac (Snow Leopard).

In terminal the

11条回答
  •  猫巷女王i
    2020-12-14 03:20

    This is the solution to my problem:

    1. Find out the path to the folder ../site-packages/ of your corresponding python version. ( For me it was /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/ for python 2.6 on my Mac with Snoe Leopard.)
    2. Open eclipse preferences and go to PyDev -> Interpreter - Python.
    3. On the left side of the lower box, click on New Folder.
    4. Add the navigate to ../site-packages/ of your corresponding python version.
    5. Hit open.
    6. Hit Apply.
    7. Hit Ok.

    And you should be good to go. =)

    Thanks @all particionts, who provided hints into the right direction in the comments.

提交回复
热议问题