我是Python的新手(来自C ++),在Brackets中运行一些测试代码。现在pylint抱怨说:
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)
答案 0 :(得分:4)
另一个答案似乎可能有用,因为我在我的盒子上得到完全相同的问题(Linux Mint,Python 3.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'
答案 1 :(得分:2)
您可能错过了第一条错误消息。 pylint
不需要任何额外的模块:它只是希望您记录您的模块。
您可能需要查看this question以禁用此警告。