我是Python新手(来自C++),在括号中运行一些测试代码。现在皮林特抱怨说:
C0111 > Missing module docstring [missing-docstring @ 1,0]所以我试着安装它:
Manuelas-MacBook:~ manu$ sudo -H pip install docstring
Collecting docstring
Downloading docstring-0.1.2.4.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/tmp/pip-build-ex4m9h3o/docstring/setup.py", line 2, in <module>
import docstring
File "/private/tmp/pip-build-ex4m9h3o/docstring/docstring/__init__.py", line 11, in <module>
from utils import Endpoint
ModuleNotFoundError: No module named 'utils'所以我安装了utils:
sudo -H pip install utils现在我被困在这里:
Manuelas-MacBook:~ manu$ sudo -H pip install docstring
Collecting docstring
Using cached docstring-0.1.2.4.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/tmp/pip-build-5bn12ekx/docstring/setup.py", line 2, in <module>
import docstring
File "/private/tmp/pip-build-5bn12ekx/docstring/docstring/__init__.py", line 11, in <module>
from utils import Endpoint
ImportError: cannot import name 'Endpoint'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-build-5bn12ekx/docstring/我也不知道怎么从这里开始。
我最近安装了python3 (在Mac上)。能给我一个版本冲突吗?
Manuelas-MacBook:~ manu$ python --version
Python 3.6.0 :: Anaconda 4.3.1 (x86_64)
Manuelas-MacBook:~ manu$ pip --version
pip 9.0.1 from /Users/manu/anaconda/lib/python3.6/site-packages (python 3.6)发布于 2017-04-27 12:45:09
错误信息非常不清楚。实际上,pylint不需要任何额外的模块:它只是希望您记录您的模块。
您可能需要查看this question来禁用此警告。
发布于 2017-04-27 12:58:29
另一个答案似乎很有帮助,因为我在我的机器上遇到了完全相同的问题(Linux,Python3.6)。原因可能是docstring与Python3不兼容。
Collecting docstring
Using cached docstring-0.1.2.4.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-v8oxns74/docstring/setup.py", line 2, in <module>
import docstring
File "/tmp/pip-build-v8oxns74/docstring/docstring/__init__.py", line 11, in <module>
from utils import Endpoint
ImportError: cannot import name 'Endpoint'https://stackoverflow.com/questions/43657677
复制相似问题