我想使用以下命令在ubuntu 14.04(vagrant)上安装jupyter:sudo pip install jupyter,但是有错误,你能告诉我如何解决它。
vagrant@vagrant-ubuntu-trusty-64:~$ pip install jupyter
Downloading/unpacking jupyter
Downloading jupyter-1.0.0-py2.py3-none-any.whl
Downloading/unpacking ipywidgets (from jupyter)
Downloading ipywidgets-6.0.0-py2.py3-none-any.whl (46kB): 46kB downloaded
Cleaning up...
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundl e=self.bundle)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1266, in prepare_file s
req_to_install.extras):
File "/usr/share/python-wheels/setuptools-3.3-py2.py3-none-any.whl/pkg_resourc es.py", line 2291, in requires
dm = self._dep_map
File "/usr/share/python-wheels/setuptools-3.3-py2.py3-none-any.whl/pkg_resourc es.py", line 2484, in _dep_map
self.__dep_map = self._compute_dependencies()
File "/usr/share/python-wheels/setuptools-3.3-py2.py3-none-any.whl/pkg_resourc es.py", line 2508, in _compute_dependencies
parsed = next(parse_requirements(distvers))
File "/usr/share/python-wheels/setuptools-3.3-py2.py3-none-any.whl/pkg_resourc es.py", line 45, in <lambda>
next = lambda o: o.next()
File "/usr/share/python-wheels/setuptools-3.3-py2.py3-none-any.whl/pkg_resourc es.py", line 2605, in parse_requirements
line, p, specs = scan_list(VERSION,LINE_END,line,p,(1,2),"version spec")
File "/usr/share/python-wheels/setuptools-3.3-py2.py3-none-any.whl/pkg_resourc es.py", line 2573, in scan_list
raise ValueError("Expected "+item_name+" in",line,"at",line[p:])
ValueError: ('Expected version spec in', 'widgetsnbextension ~=2.0.0', 'at', ' ~ =2.0.0')
Storing debug log for failure in /home/vagrant/.pip/pip.log
答案 0 :(得分:4)
我解决了。由于点数版本是1.5.4(您可以通过点子-V确认),因此需要升级点数。一开始,我无法升级pip:pip install --upgrade pip。我用另一种方法来升级pip(https://askubuntu.com/questions/775942/how-to-install-the-latest-version-of-pip-when-i-already-installed-the-provided-b):
wget https://pypi.python.org/packages/e7/a8/7556133689add8d1a54c0b14aeff0acb03c64707ce100ecd53934da1aa13/pip-8.1.2.tar.gz
tar -xzvf pip-8.1.2.tar.gz
cd pip-8.1.2
sudo python setup.py install
然后通过以下方式升级到最新版本的pip:pip install --upgrade pip
然后我可以通过以下方式安装jupyter:sudo pip install jupyter。