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

前端 未结 11 2097
难免孤独
难免孤独 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条回答
  •  时光取名叫无心
    2020-12-14 03:25

    In my case I was not getting this error before compiling, but when I compile I got the error ImportError: No module named myant.core. I tried to add the files from PyDev-PYTHONPATH, but again I got the same error. Then I realized that I actually do not have to add the path exactly to the folder where my .py files are located. Infact I have to add the folder where myant.core is located. After doing this I did a restart when I recompiled my project again, the problem was fixed. I would share that I have:

    Python 2.7 Eclipse kepler 4.3, PyDev 3.9.2 and on my ubuntu 14.04

    .py files location:/${PROJECT_DIR_NAME}/src/myant/core, therefore I added /${PROJECT_DIR_NAME}/src

提交回复
热议问题