0
我PyDev的Eclipse项目中只有一个与这些四行文件:为什么PyDev Eclipse编辑器在不存在的代码中报告错误?
import os
from six.moves.urllib.request import urlretrieve
from six.moves import cPickle as pickle
print("OK")
Eclipse的报告,这些 “问题”:
Unresolved import: pickle main.py /1_notminst line 2 PyDev Problem
Unresolved import: urlretrieve main.py /1_notminst line 1 PyDev Problem
然而,Eclipse的,没有任何问题,运行程序,并打印“OK ”,以及命令行python3(或ipython3):
> python3 main.py
OK
任何想法,为什么Eclipse的+的PyDev的编辑并没有看到该库?它是Python六库。 pip3报告库安装:
> pip3 show six
---
Metadata-Version: 1.1
Name: six
Version: 1.10.0
Summary: Python 2 and 3 compatibility utilities
Home-page: http://pypi.python.org/pypi/six/
Author: Benjamin Peterson
Author-email: [email protected]
License: MIT
Location: /usr/lib/python3/dist-packages
Requires:
Classifiers:
Programming Language :: Python :: 2
Programming Language :: Python :: 3
Intended Audience :: Developers
License :: OSI Approved :: MIT License
Topic :: Software Development :: Libraries
Topic :: Utilities
其他库的导入就好了。
我在Ubuntu 16.04和Python 3.5下运行Eclipse Mars。
谢谢!