Eclipse + Pydev开发Python时import报错解决方法


一.  原文链接:http://blog.csdn.net/lhanchao/article/details/51306626           
用eclipse +PyDev开发python时,需要import其他文件时eclipse会报错,但是在python的命令行中运行却没有问题。
据人分析其实发生错误的原因是在Preferences->Pydev->Interpreter-Python中的SystemPYTHONPATH 引用不完全,不知道你发现没有,在python3.1中的SystemPYTHONPATH比在python2.x中的少很多,而在python2.x中就不会出现类似的import错误。
------------------------------------------------------------------------------------------------------------------
下面是问题的解决方法:

1.右键工程——properties
2.选择Pydev-Interface/Grammar,点击链接Click here to configure aninterpreter not listed
3.在python Interperter中选择New Folder,添加文件的父目录即可。

二.我的方法
   然并卵,添加配置之后会导致上层目录.. 的引用不能成功,于是换用PyCharm作为开发工具。
  使用Eric6和Pycharm混合,取代PyDev
原文地址:https://www.cnblogs.com/wishchin/p/9199894.html