【问题标题】:pip3 not installing Jupyter on Windowspip3 没有在 Windows 上安装 Jupyter
【发布时间】:2017-03-25 13:04:26
【问题描述】:

这是我第一次来这里。所以,对于我可能犯的任何错误,请提前道歉。

我在我的 Windows 8 上安装了 Python 3.6.1。然后我尝试通过 pip3 方法安装 Jupyter,因为 Anaconda 在下载时总是失败(过去一年我尝试了十几次,今天我又尝试了两次)。我关注instructions given 然后发生这种情况:

   Microsoft Windows [Versión 6.2.9200]
    (c) 2012 Microsoft Corporation. Todos los derechos reservados.

C:\Users\Myuser>pip3 install --upgrade pip
Requirement already up-to-date: pip in c:\users\myuser\appdata\local\programs\pyt
hon\python36-32\lib\site-packages

C:\Users\Myuser>pip3 install jupyter
Collecting jupyter
  Downloading jupyter-1.0.0-py2.py3-none-any.whl
Collecting ipywidgets (from jupyter)
  Downloading ipywidgets-6.0.0-py2.py3-none-any.whl (46kB)
    100% |████████████████████████████████| 51kB 409kB/s
Collecting qtconsole (from jupyter)
  Downloading qtconsole-4.2.1-py2.py3-none-any.whl (104kB)
    100% |████████████████████████████████| 112kB 936kB/s
Collecting nbconvert (from jupyter)
  Downloading nbconvert-5.1.1-py2.py3-none-any.whl (372kB)
    100% |████████████████████████████████| 378kB 728kB/s
Collecting ipykernel (from jupyter)
  Downloading ipykernel-4.5.2-py2.py3-none-any.whl (98kB)
    100% |████████████████████████████████| 102kB 1.6MB/s
Collecting jupyter-console (from jupyter)
  Downloading jupyter_console-5.1.0-py2.py3-none-any.whl
Collecting notebook (from jupyter)
  Downloading notebook-4.4.1-py2.py3-none-any.whl (6.9MB)
    100% |████████████████████████████████| 6.9MB 93kB/s
Collecting nbformat>=4.2.0 (from ipywidgets->jupyter)
  Downloading nbformat-4.3.0-py2.py3-none-any.whl (154kB)
    100% |████████████████████████████████| 163kB 1.2MB/s
Collecting traitlets>=4.3.1 (from ipywidgets->jupyter)
  Downloading traitlets-4.3.2-py2.py3-none-any.whl (74kB)
    100% |████████████████████████████████| 81kB 1.5MB/s
Collecting widgetsnbextension~=2.0.0 (from ipywidgets->jupyter)
  Downloading widgetsnbextension-2.0.0-py2.py3-none-any.whl (1.1MB)
    100% |████████████████████████████████| 1.1MB 457kB/s
Collecting ipython>=4.0.0 (from ipywidgets->jupyter)
  Downloading ipython-5.3.0-py3-none-any.whl (750kB)
    100% |████████████████████████████████| 757kB 676kB/s
Collecting jupyter-core (from qtconsole->jupyter)
  Downloading jupyter_core-4.3.0-py2.py3-none-any.whl (76kB)
    100% |████████████████████████████████| 81kB 1.1MB/s
Collecting pygments (from qtconsole->jupyter)
  Downloading Pygments-2.2.0-py2.py3-none-any.whl (841kB)
    100% |████████████████████████████████| 849kB 356kB/s
Collecting jupyter-client>=4.1 (from qtconsole->jupyter)
  Downloading jupyter_client-5.0.0-py2.py3-none-any.whl (83kB)
    100% |████████████████████████████████| 92kB 522kB/s
Collecting bleach (from nbconvert->jupyter)
  Downloading bleach-2.0.0-py2.py3-none-any.whl
Collecting mistune!=0.6 (from nbconvert->jupyter)
  Downloading mistune-0.7.4-py2.py3-none-any.whl
Collecting pandocfilters>=1.4.1 (from nbconvert->jupyter)
  Downloading pandocfilters-1.4.1.tar.gz
Collecting testpath (from nbconvert->jupyter)
  Downloading testpath-0.3-py2.py3-none-any.whl (82kB)
    100% |████████████████████████████████| 92kB 1.3MB/s
Collecting entrypoints>=0.2.2 (from nbconvert->jupyter)
  Downloading entrypoints-0.2.2-py2.py3-none-any.whl
Collecting jinja2 (from nbconvert->jupyter)
  Downloading Jinja2-2.9.5-py2.py3-none-any.whl (340kB)
    100% |████████████████████████████████| 348kB 1.5MB/s
Collecting tornado>=4.0 (from ipykernel->jupyter)
  Downloading tornado-4.4.2.tar.gz (460kB)
    100% |████████████████████████████████| 460kB 982kB/s
Collecting prompt-toolkit<2.0.0,>=1.0.0 (from jupyter-console->jupyter)
  Downloading prompt_toolkit-1.0.13-py3-none-any.whl (247kB)
    100% |████████████████████████████████| 256kB 1.3MB/s
Collecting ipython-genutils (from notebook->jupyter)
  Downloading ipython_genutils-0.2.0-py2.py3-none-any.whl
Collecting jsonschema!=2.5.0,>=2.4 (from nbformat>=4.2.0->ipywidgets->jupyter)
  Downloading jsonschema-2.6.0-py2.py3-none-any.whl
Collecting six (from traitlets>=4.3.1->ipywidgets->jupyter)
  Downloading six-1.10.0-py2.py3-none-any.whl
Collecting decorator (from traitlets>=4.3.1->ipywidgets->jupyter)
  Downloading decorator-4.0.11-py2.py3-none-any.whl
Requirement already satisfied: setuptools>=18.5 in c:\users\myuser\appdata\local\
programs\python\python36-32\lib\site-packages (from ipython>=4.0.0->ipywidgets->
jupyter)
Collecting colorama; sys_platform == "win32" (from ipython>=4.0.0->ipywidgets->j
upyter)
  Downloading colorama-0.3.7-py2.py3-none-any.whl
Collecting pickleshare (from ipython>=4.0.0->ipywidgets->jupyter)
  Downloading pickleshare-0.7.4-py2.py3-none-any.whl
Collecting simplegeneric>0.8 (from ipython>=4.0.0->ipywidgets->jupyter)
  Downloading simplegeneric-0.8.1.zip
Collecting pyzmq>=13 (from jupyter-client>=4.1->qtconsole->jupyter)
  Downloading pyzmq-16.0.2-cp36-cp36m-win32.whl (790kB)
    100% |████████████████████████████████| 798kB 147kB/s
Collecting python-dateutil>=2.1 (from jupyter-client>=4.1->qtconsole->jupyter)
  Downloading python_dateutil-2.6.0-py2.py3-none-any.whl (194kB)
    100% |████████████████████████████████| 194kB 1.7MB/s
Collecting html5lib>=0.99999999 (from bleach->nbconvert->jupyter)
  Downloading html5lib-0.999999999-py2.py3-none-any.whl (112kB)
    100% |████████████████████████████████| 122kB 1.6MB/s
Collecting MarkupSafe>=0.23 (from jinja2->nbconvert->jupyter)
  Downloading MarkupSafe-1.0.tar.gz
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 webencodings (from html5lib>=0.99999999->bleach->nbconvert->jupyter)
  Downloading webencodings-0.5.tar.gz
Installing collected packages: tornado, pyzmq, six, ipython-genutils, decorator,
 traitlets, jupyter-core, python-dateutil, jupyter-client, colorama, pickleshare
, simplegeneric, wcwidth, prompt-toolkit, pygments, ipython, ipykernel, jsonsche
ma, nbformat, webencodings, html5lib, bleach, mistune, pandocfilters, testpath,
entrypoints, MarkupSafe, jinja2, nbconvert, notebook, widgetsnbextension, ipywid
gets, qtconsole, jupyter-console, jupyter
  Running setup.py install for tornado ... error
Exception:
Traceback (most recent call last):
  File "c:\users\myuser\appdata\local\programs\python\python36-32\lib\site-packag
es\pip\compat\__init__.py", line 73, in console_to_str
    return s.decode(sys.__stdout__.encoding)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe0 in position 22: invalid
 continuation byte

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\myuser\appdata\local\programs\python\python36-32\lib\site-packag
es\pip\commands\install.py", line 342, in run
    prefix=options.prefix_path,
  File "c:\users\myuser\appdata\local\programs\python\python36-32\lib\site-packag
es\pip\req\req_set.py", line 784, in install
    **kwargs
  File "c:\users\myuser\appdata\local\programs\python\python36-32\lib\site-packag
es\pip\req\req_install.py", line 878, in install
    spinner=spinner,
  File "c:\users\myuser\appdata\local\programs\python\python36-32\lib\site-packag
es\pip\utils\__init__.py", line 676, in call_subprocess
    line = console_to_str(proc.stdout.readline())
  File "c:\users\myuser\appdata\local\programs\python\python36-32\lib\site-packag
es\pip\compat\__init__.py", line 75, in console_to_str
    return s.decode('utf_8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe0 in position 22: invalid
 continuation byte

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\myuser\appdata\local\programs\python\python36-32\lib\site-packag
es\pip\commands\install.py", line 385, in run
    requirement_set.cleanup_files()
  File "c:\users\myuser\appdata\local\programs\python\python36-32\lib\site-packag
es\pip\req\req_set.py", line 729, in cleanup_files
    req.remove_temporary_source()
  File "c:\users\myuser\appdata\local\programs\python\python36-32\lib\site-packag
es\pip\req\req_install.py", line 977, in remove_temporary_source
    rmtree(self.source_dir)
  File "c:\users\myuser\appdata\local\programs\python\python36-32\lib\site-packag
es\pip\_vendor\retrying.py", line 49, in wrapped_f
    return Retrying(*dargs, **dkw).call(f, *args, **kw)
  File "c:\users\myuser\appdata\local\programs\python\python36-32\lib\site-packag
es\pip\_vendor\retrying.py", line 212, in call
    raise attempt.get()
  File "c:\users\myuser\appdata\local\programs\python\python36-32\lib\site-packag
es\pip\_vendor\retrying.py", line 247, in get
    six.reraise(self.value[0], self.value[1], self.value[2])
  File "c:\users\myuser\appdata\local\programs\python\python36-32\lib\site-packag
es\pip\_vendor\six.py", line 686, in reraise
    raise value
  File "c:\users\myuser\appdata\local\programs\python\python36-32\lib\site-packag
es\pip\_vendor\retrying.py", line 200, in call
    attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
  File "c:\users\myuser\appdata\local\programs\python\python36-32\lib\site-packag
es\pip\utils\__init__.py", line 102, in rmtree
    onerror=rmtree_errorhandler)
  File "c:\users\myuser\appdata\local\programs\python\python36-32\lib\shutil.py",
 line 494, in rmtree
    return _rmtree_unsafe(path, onerror)
  File "c:\users\myuser\appdata\local\programs\python\python36-32\lib\shutil.py",
 line 393, in _rmtree_unsafe
    onerror(os.rmdir, path, sys.exc_info())
  File "c:\users\myuser\appdata\local\programs\python\python36-32\lib\site-packag
es\pip\utils\__init__.py", line 114, in rmtree_errorhandler
    func(path)
PermissionError: [WinError 32] El proceso no tiene acceso al archivo porque está
 siendo utilizado por otro proceso: 'C:\\Users\\MYUSER\\AppData\\Local\\Temp\\pi
p-build-fives7dn\\tornado'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\myuser\appdata\local\programs\python\python36-32\lib\site-packag
es\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "c:\users\myuser\appdata\local\programs\python\python36-32\lib\site-packag
es\pip\commands\install.py", line 385, in run
    requirement_set.cleanup_files()
  File "c:\users\myuser\appdata\local\programs\python\python36-32\lib\site-packag
es\pip\utils\build.py", line 38, in __exit__
    self.cleanup()
  File "c:\users\myuser\appdata\local\programs\python\python36-32\lib\site-packag
es\pip\utils\build.py", line 42, in cleanup
    rmtree(self.name)
  File "c:\users\myuser\appdata\local\programs\python\python36-32\lib\site-packag
es\pip\_vendor\retrying.py", line 49, in wrapped_f
    return Retrying(*dargs, **dkw).call(f, *args, **kw)
  File "c:\users\myuser\appdata\local\programs\python\python36-32\lib\site-packag
es\pip\_vendor\retrying.py", line 212, in call
    raise attempt.get()
  File "c:\users\myuser\appdata\local\programs\python\python36-32\lib\site-packag
es\pip\_vendor\retrying.py", line 247, in get
    six.reraise(self.value[0], self.value[1], self.value[2])
  File "c:\users\myuser\appdata\local\programs\python\python36-32\lib\site-packag
es\pip\_vendor\six.py", line 686, in reraise
    raise value
  File "c:\users\myuser\appdata\local\programs\python\python36-32\lib\site-packag
es\pip\_vendor\retrying.py", line 200, in call
    attempt = Attempt(fn(*args, **kwargs), attempt_number, False)
  File "c:\users\myuser\appdata\local\programs\python\python36-32\lib\site-packag
es\pip\utils\__init__.py", line 102, in rmtree
    onerror=rmtree_errorhandler)
  File "c:\users\myuser\appdata\local\programs\python\python36-32\lib\shutil.py",
 line 494, in rmtree
    return _rmtree_unsafe(path, onerror)
  File "c:\users\myuser\appdata\local\programs\python\python36-32\lib\shutil.py",
 line 384, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
  File "c:\users\myuser\appdata\local\programs\python\python36-32\lib\shutil.py",
 line 384, in _rmtree_unsafe
    _rmtree_unsafe(fullname, onerror)
  File "c:\users\myuser\appdata\local\programs\python\python36-32\lib\shutil.py",
 line 389, in _rmtree_unsafe
    onerror(os.unlink, fullname, sys.exc_info())
  File "c:\users\myuser\appdata\local\programs\python\python36-32\lib\site-packag
es\pip\utils\__init__.py", line 114, in rmtree_errorhandler
    func(path)
PermissionError: [WinError 5] Acceso denegado: 'C:\\Users\\MYUSER\\AppData\\Loca
l\\Temp\\pip-build-fives7dn\\testpath\\testpath\\cli-32.exe'

可能是我的用户名名称中包含“à”?如果是这样的话,我该怎么办?

【问题讨论】:

  • 我不再使用这个操作系统,所以我无法告诉人们您提出的解决方案是否有效。尽管如此,我希望有这个问题的人能欣赏你的回答!

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


【解决方案1】:

问题实际上只是因为您的用户名中的“à”。这是错误:

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe0 in position 22: invalid continuation byte

您只需删除用户名中一些不符合标准 utf-8 字符的字符,例如,将“à”更改为“a”。

【讨论】:

    【解决方案2】:

    遇到了和你一样的问题。我将我的 Python 更新到 3.6.1 版并重新安装 Jupyter 笔记本。我在pip设置tornado时遇到第一个问题UnicodeDecodeError,我的系统是Windows 8.1 64bit。 这是我要解决的问题:

    • 我打开安装新python的目录...\Python\Python36\Lib\site-packages\tornado
    • 打开安装旧python的目录...\Python\Python35\Lib\site-packages\tornado
    • 然后我从旧龙卷风中复制并覆盖新龙卷风目录中的所有 *.py 文件(注意:我的旧龙卷风是最新的 4.4.2)
    • 然后我再次运行指令pip install jupyter notebook

    然后在 pip 设置 MarkupSafe 时出现同样的问题,我做的和上面一样。这次指令 pip install jupyter notebook 不再抛出错误。Jupyter notebook 工作正常。

    觉得如果你有Jupyter的旧版本模块,可以像我一样尝试,或者考虑手动下载错误模块并将它们放在正确的目录中。

    希望对你有帮助。

    【讨论】:

      猜你喜欢
      • 2017-05-20
      • 2019-07-02
      • 1970-01-01
      • 2017-04-27
      • 2018-01-09
      • 2020-01-22
      • 2018-04-25
      • 2018-02-09
      • 2021-01-05
      相关资源
      最近更新 更多