1. 程式人生 > >pip 安裝jupyter notebook的一次異常

pip 安裝jupyter notebook的一次異常

當我pip install jupyter notebook 時,出現如下錯誤:

Collecting tornado>=4 (from notebook->jupyter)
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/45/ec/f2a03a0509bcfca336bef23a3dab0d07504893af34fd13064059ba4a0503/tornado-5.1.tar.gz (516kB)
    100% |████████████████████████████████| 522kB 11.6MB/s 
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-Rd9iXW/tornado/setup.py", line 195, in <module>
        **kwargs
      File "/usr/lib/python2.7/distutils/core.py", line 111, in setup
        _setup_distribution = dist = klass(attrs)
      File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 272, in __init__
        _Distribution.__init__(self,attrs)
      File "/usr/lib/python2.7/distutils/dist.py", line 287, in __init__
        self.finalize_options()
      File "/usr/lib/python2.7/dist-packages/setuptools/dist.py", line 327, in finalize_options
        ep.load()(self, ep.name, value)
      File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2229, in load
        return self.resolve()
      File "/usr/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2239, in resolve
        raise ImportError(str(exc))
    ImportError: 'module' object has no attribute 'check_specifier'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-Rd9iXW/tornado/

網上谷歌了一下,無果。就去看了一下setup.py這個檔案,結果發現tornado5可能不支援Python2,就去網上下載了tornado4.2,再次pip install jupyter notebook

就可以啦。