例外:在Ubuntu上安装jupyter时出错

时间:2018-03-28 18:42:25

标签: python python-3.x python-2.7 jupyter-notebook jupyter

安装Jupyter时,我几乎完成了,直到最后出现了一个叫做异常的东西。我是Ubuntu和Python的新手,所以无法理解这些事情。

pip install jupyter
Collecting jupyter
Downloading jupyter-1.0.0-py2.py3-none-any.whl
Collecting nbconvert (from jupyter)
Downloading nbconvert-5.3.1-py2.py3-none-any.whl (387kB)
100% |████████████████████████████████| 389kB 1.3MB/s 
Collecting ipywidgets (from jupyter)
 Downloading ipywidgets-7.1.2-py2.py3-none-any.whl (68kB)
 100% |████████████████████████████████| 71kB 3.5MB/s 
 Collecting notebook (from jupyter)


`enter code here` Downloading notebook-5.4.1-py2.py3-none-any.whl (8.0MB)
    100% |████████████████████████████████| 8.0MB 106kB/s 
Collecting qtconsole (from jupyter)
  Downloading qtconsole-4.3.1-py2.py3-none-any.whl (108kB)
    100% |████████████████████████████████| 112kB 4.9MB/s 
Collecting jupyter-console (from jupyter)
  Downloading jupyter_console-5.2.0-py2.py3-none-any.whl
Collecting ipykernel (from jupyter)
  Downloading ipykernel-4.8.2-py2-none-any.whl (108kB)
    100% |████████████████████████████████| 112kB 5.2MB/s 
Collecting pandocfilters>=1.4.1 (from nbconvert->jupyter)
  Downloading pandocfilters-1.4.2.tar.gz
Collecting entrypoints>=0.2.2 (from nbconvert->jupyter)
  Downloading entrypoints-0.2.3-py2.py3-none-any.whl
Collecting jinja2 (from nbconvert->jupyter)
  Downloading Jinja2-2.10-py2.py3-none-any.whl (126kB)
    100% |████████████████████████████████| 133kB 3.2MB/s 
Collecting testpath (from nbconvert->jupyter)
  Downloading testpath-0.3.1-py2.py3-none-any.whl (161kB)
    100% |████████████████████████████████| 163kB 2.9MB/s 
Collecting mistune>=0.7.4 (from nbconvert->jupyter)
  Downloading mistune-0.8.3-py2.py3-none-any.whl
Collecting nbformat>=4.4 (from nbconvert->jupyter)
  Downloading nbformat-4.4.0-py2.py3-none-any.whl (155kB)
    100% |████████████████████████████████| 163kB 3.5MB/s 
Collecting pygments (from nbconvert->jupyter)
  Downloading Pygments-2.2.0-py2.py3-none-any.whl (841kB)
    100% |████████████████████████████████| 849kB 975kB/s 
Collecting bleach (from nbconvert->jupyter)
  Downloading bleach-2.1.3-py2.py3-none-any.whl
Collecting traitlets>=4.2 (from nbconvert->jupyter)
  Downloading traitlets-4.3.2-py2.py3-none-any.whl (74kB)
    100% |████████████████████████████████| 81kB 4.6MB/s 
Collecting jupyter-core (from nbconvert->jupyter)
  Downloading jupyter_core-4.4.0-py2.py3-none-any.whl (126kB)
    100% |████████████████████████████████| 133kB 4.5MB/s 
Collecting widgetsnbextension~=3.1.0 (from ipywidgets->jupyter)
  Downloading widgetsnbextension-3.1.4-py2.py3-none-any.whl (2.2MB)
    100% |████████████████████████████████| 2.2MB 392kB/s 
Collecting ipython<6.0.0,>=4.0.0; python_version < "3.3" (from ipywidgets->jupyter)
  Downloading ipython-5.5.0-py2-none-any.whl (758kB)
    100% |████████████████████████████████| 768kB 1.1MB/s 
Collecting Send2Trash (from notebook->jupyter)
  Downloading Send2Trash-1.5.0.tar.gz
Collecting ipython-genutils (from notebook->jupyter)
  Downloading ipython_genutils-0.2.0-py2.py3-none-any.whl
Collecting jupyter-client>=5.2.0 (from notebook->jupyter)
  Downloading jupyter_client-5.2.3-py2.py3-none-any.whl (89kB)
    100% |████████████████████████████████| 92kB 4.5MB/s 
Collecting tornado>=4 (from notebook->jupyter)
  Downloading tornado-5.0.1.tar.gz (504kB)
    100% |████████████████████████████████| 512kB 1.5MB/s 
Collecting terminado>=0.8.1 (from notebook->jupyter)
  Downloading terminado-0.8.1-py2.py3-none-any.whl
Collecting prompt-toolkit<2.0.0,>=1.0.0 (from jupyter-console->jupyter)
  Downloading prompt_toolkit-1.0.15-py2-none-any.whl (247kB)
    100% |████████████████████████████████| 256kB 2.6MB/s 
Collecting configparser>=3.5; python_version == "2.7" (from entrypoints>=0.2.2->nbconvert->jupyter)
  Downloading configparser-3.5.0.tar.gz
Collecting MarkupSafe>=0.23 (from jinja2->nbconvert->jupyter)
  Downloading MarkupSafe-1.0.tar.gz
Collecting jsonschema!=2.5.0,>=2.4 (from nbformat>=4.4->nbconvert->jupyter)
  Downloading jsonschema-2.6.0-py2.py3-none-any.whl
Collecting html5lib!=1.0b1,!=1.0b2,!=1.0b3,!=1.0b4,!=1.0b5,!=1.0b6,!=1.0b7,!=1.0b8,>=0.99999999pre (from bleach->nbconvert->jupyter)
  Downloading html5lib-1.0.1-py2.py3-none-any.whl (117kB)
    100% |████████████████████████████████| 122kB 4.3MB/s 
Requirement already satisfied: six in /usr/lib/python2.7/dist-packages (from bleach->nbconvert->jupyter)
Collecting decorator (from traitlets>=4.2->nbconvert->jupyter)
  Downloading decorator-4.2.1-py2.py3-none-any.whl
Collecting enum34; python_version == "2.7" (from traitlets>=4.2->nbconvert->jupyter)
  Downloading enum34-1.1.6-py2-none-any.whl
Collecting pexpect; sys_platform != "win32" (from ipython<6.0.0,>=4.0.0; python_version < "3.3"->ipywidgets->jupyter)
  Downloading pexpect-4.4.0-py2.py3-none-any.whl (56kB)
    100% |████████████████████████████████| 61kB 5.1MB/s 
Collecting backports.shutil-get-terminal-size; python_version == "2.7" (from ipython<6.0.0,>=4.0.0; python_version < "3.3"->ipywidgets->jupyter)
  Downloading backports.shutil_get_terminal_size-1.0.0-py2.py3-none-any.whl
Requirement already satisfied: setuptools>=18.5 in /usr/lib/python2.7/dist-packages (from ipython<6.0.0,>=4.0.0; python_version < "3.3"->ipywidgets->jupyter)
Collecting pathlib2; python_version == "2.7" or python_version == "3.3" (from ipython<6.0.0,>=4.0.0; python_version < "3.3"->ipywidgets->jupyter)
  Downloading pathlib2-2.3.0-py2.py3-none-any.whl
Collecting simplegeneric>0.8 (from ipython<6.0.0,>=4.0.0; python_version < "3.3"->ipywidgets->jupyter)
  Downloading simplegeneric-0.8.1.zip
Collecting pickleshare (from ipython<6.0.0,>=4.0.0; python_version < "3.3"->ipywidgets->jupyter)
  Downloading pickleshare-0.7.4-py2.py3-none-any.whl
Collecting pyzmq>=13 (from jupyter-client>=5.2.0->notebook->jupyter)
  Downloading pyzmq-17.0.0-cp27-cp27mu-manylinux1_x86_64.whl (3.0MB)
    100% |████████████████████████████████| 3.0MB 281kB/s 
Collecting python-dateutil>=2.1 (from jupyter-client>=5.2.0->notebook->jupyter)
  Downloading python_dateutil-2.7.2-py2.py3-none-any.whl (212kB)
    100% |████████████████████████████████| 215kB 2.9MB/s 
Collecting futures (from tornado>=4->notebook->jupyter)
  Downloading futures-3.2.0-py2-none-any.whl
Collecting singledispatch (from tornado>=4->notebook->jupyter)
  Downloading singledispatch-3.4.0.3-py2.py3-none-any.whl
Collecting backports_abc>=0.4 (from tornado>=4->notebook->jupyter)
  Downloading backports_abc-0.5-py2.py3-none-any.whl
Collecting ptyprocess; os_name != "nt" (from terminado>=0.8.1->notebook->jupyter)
  Downloading ptyprocess-0.5.2-py2.py3-none-any.whl
Collecting wcwidth (from prompt-toolkit<2.0.0,>=1.0.0->jupyter-console->jupyter)
  Downloading wcwidth-0.1.7-py2.py3-none-any.whl
Collecting functools32; python_version == "2.7" (from jsonschema!=2.5.0,>=2.4->nbformat>=4.4->nbconvert->jupyter)
  Downloading functools32-3.2.3-2.tar.gz
Collecting webencodings (from html5lib!=1.0b1,!=1.0b2,!=1.0b3,!=1.0b4,!=1.0b5,!=1.0b6,!=1.0b7,!=1.0b8,>=0.99999999pre->bleach->nbconvert->jupyter)
  Downloading webencodings-0.5.1-py2.py3-none-any.whl
Collecting scandir; python_version < "3.5" (from pathlib2; python_version == "2.7" or python_version == "3.3"->ipython<6.0.0,>=4.0.0; python_version < "3.3"->ipywidgets->jupyter)
  Downloading scandir-1.7.tar.gz
Building wheels for collected packages: pandocfilters, Send2Trash, tornado, configparser, MarkupSafe, simplegeneric, functools32, scandir
  Running setup.py bdist_wheel for pandocfilters ... done
  Stored in directory: /home/mukul/.cache/pip/wheels/08/5b/5b/66b3cde6f8215f8345479ef3699d6ddbb860f6ea7072008f8b
  Running setup.py bdist_wheel for Send2Trash ... done
  Stored in directory: /home/mukul/.cache/pip/wheels/7e/53/4f/bba4eeb954fb986a22a98b8ead0fce8f4f1f4e8028ed715530
  Running setup.py bdist_wheel for tornado ... done
  Stored in directory: /home/mukul/.cache/pip/wheels/fd/0d/50/bb8bebaf371beed13f2502466cdadc9ef2afb3302e66a56a36
  Running setup.py bdist_wheel for configparser ... done
  Stored in directory: /home/mukul/.cache/pip/wheels/1c/bd/b4/277af3f6c40645661b4cd1c21df26aca0f2e1e9714a1d4cda8
  Running setup.py bdist_wheel for MarkupSafe ... done
  Stored in directory: /home/mukul/.cache/pip/wheels/88/a7/30/e39a54a87bcbe25308fa3ca64e8ddc75d9b3e5afa21ee32d57
  Running setup.py bdist_wheel for simplegeneric ... done
  Stored in directory: /home/mukul/.cache/pip/wheels/7b/31/08/c85e74c84188cbec6a6827beec4d640f2bd78ae003dc1ec09d
  Running setup.py bdist_wheel for functools32 ... done
  Stored in directory: /home/mukul/.cache/pip/wheels/b5/83/8b/2de165caa2da68be141fbf343fd291fbcae73094c213ba3f5c
  Running setup.py bdist_wheel for scandir ... done
  Stored in directory: /home/mukul/.cache/pip/wheels/3d/51/95/79b749f7e52b5dea9e01b5c72da1c728151fc65a3984c37bec
Successfully built pandocfilters Send2Trash tornado configparser MarkupSafe simplegeneric functools32 scandir
Installing collected packages: pandocfilters, configparser, entrypoints, MarkupSafe, jinja2, testpath, mistune, ipython-genutils, decorator, enum34, traitlets, jupyter-core, functools32, jsonschema, nbformat, pygments, webencodings, html5lib, bleach, nbconvert, Send2Trash, futures, singledispatch, backports-abc, tornado, pyzmq, python-dateutil, jupyter-client, ptyprocess, terminado, wcwidth, prompt-toolkit, pexpect, backports.shutil-get-terminal-size, scandir, pathlib2, simplegeneric, pickleshare, ipython, ipykernel, notebook, widgetsnbextension, ipywidgets, qtconsole, jupyter-console, jupyter
Exception:
Traceback (most recent call last):
  File "/home/mukul/.local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/home/mukul/.local/lib/python2.7/site-packages/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/home/mukul/.local/lib/python2.7/site-packages/pip/req/req_set.py", line 784, in install
    **kwargs
  File "/home/mukul/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/home/mukul/.local/lib/python2.7/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "/home/mukul/.local/lib/python2.7/site-packages/pip/wheel.py", line 345, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/home/mukul/.local/lib/python2.7/site-packages/pip/wheel.py", line 323, in clobber
    shutil.copyfile(srcfile, destfile)
  File "/usr/lib/python2.7/shutil.py", line 83, in copyfile
    with open(dst, 'wb') as fdst:
IOError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/pandocfilters.py'

虽然安装jupyter一切正常,但最后我有一些例外。我无法理解这些是什么。

1 个答案:

答案 0 :(得分:3)

您收到错误IOError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/pandocfilters.py',因为您正在普通用户下运行pip install

您可以使用sudo pip install jupyter运行此命令。这将在安装时为您提供root权限,或者您可以在virtualenv中查看运行它。您可以在https://docs.python.org/3/tutorial/venv.html了解有关virtualenv的更多信息。