我是Python新手(來自C++),在Brackets中運行一些測試代碼。現在pylint的笙歌說:無法安裝模塊'docstring'
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)
啊,就是這樣!我意識到它要我記錄,但我確實認爲它需要docstring模塊。感謝您的澄清! –