【问题标题】:How can I solve this error when install jupyter with python 2.7 in my Windows 10在我的 Windows 10 中使用 python 2.7 安装 jupyter 时如何解决此错误
【发布时间】:2017-05-29 13:08:42
【问题描述】:

我在Windows 10中安装了python 2.7,并设置了HOME、PATH环境变量。

然后输入

pip 安装 jupyter

结果是这样的:

Collecting jupyter
  Using cached jupyter-1.0.0-py2.py3-none-any.whl
Collecting ipykernel (from jupyter)
  Using cached ipykernel-4.5.2-py2.py3-none-any.whl
Collecting jupyter-console (from jupyter)
  Using cached jupyter_console-5.0.0-py2.py3-none-any.whl
Collecting ipywidgets (from jupyter)
  Using cached ipywidgets-5.2.2-py2.py3-none-any.whl
Collecting nbconvert (from jupyter)
  Using cached nbconvert-5.0.0-py2.py3-none-any.whl
Collecting notebook (from jupyter)
  Using cached notebook-4.3.1-py2.py3-none-any.whl
Collecting qtconsole (from jupyter)
  Using cached qtconsole-4.2.1-py2.py3-none-any.whl
Collecting tornado>=4.0 (from ipykernel->jupyter)
  Using cached tornado-4.4.2.tar.gz
Collecting jupyter-client (from ipykernel->jupyter)
  Using cached jupyter_client-4.4.0-py2.py3-none-any.whl
Collecting ipython>=4.0.0 (from ipykernel->jupyter)
  Using cached ipython-5.1.0-py2-none-any.whl
Collecting traitlets>=4.1.0 (from ipykernel->jupyter)
  Using cached traitlets-4.3.1-py2.py3-none-any.whl
Collecting prompt-toolkit<2.0.0,>=1.0.0 (from jupyter-console->jupyter)
  Using cached prompt_toolkit-1.0.9-py2-none-any.whl
Collecting pygments (from jupyter-console->jupyter)
  Using cached Pygments-2.1.3-py2.py3-none-any.whl
Collecting widgetsnbextension>=1.2.6 (from ipywidgets->jupyter)
  Using cached widgetsnbextension-1.2.6-py2.py3-none-any.whl
Collecting testpath (from nbconvert->jupyter)
  Using cached testpath-0.3-py2.py3-none-any.whl
Collecting pandocfilters>=1.4.1 (from nbconvert->jupyter)
  Using cached pandocfilters-1.4.1.tar.gz
Collecting jinja2 (from nbconvert->jupyter)
  Using cached Jinja2-2.9.4-py2.py3-none-any.whl
Collecting jupyter-core (from nbconvert->jupyter)
  Using cached jupyter_core-4.2.1-py2.py3-none-any.whl
Collecting bleach (from nbconvert->jupyter)
  Using cached bleach-1.5.0-py2.py3-none-any.whl
Collecting mistune!=0.6 (from nbconvert->jupyter)
  Using cached mistune-0.7.3-py2.py3-none-any.whl
Collecting nbformat (from nbconvert->jupyter)
  Using cached nbformat-4.2.0-py2.py3-none-any.whl
Collecting entrypoints>=0.2.2 (from nbconvert->jupyter)
  Using cached entrypoints-0.2.2-py2.py3-none-any.whl
Collecting ipython-genutils (from notebook->jupyter)
  Using cached ipython_genutils-0.1.0-py2.py3-none-any.whl
Collecting singledispatch (from tornado>=4.0->ipykernel->jupyter)
  Using cached singledispatch-3.4.0.3-py2.py3-none-any.whl
Collecting certifi (from tornado>=4.0->ipykernel->jupyter)
  Using cached certifi-2016.9.26-py2.py3-none-any.whl
Collecting backports_abc>=0.4 (from tornado>=4.0->ipykernel->jupyter)
  Using cached backports_abc-0.5-py2.py3-none-any.whl
Collecting pyzmq>=13 (from jupyter-client->ipykernel->jupyter)
  Using cached pyzmq-16.0.2-cp27-cp27m-win32.whl
Collecting win-unicode-console>=0.5; sys_platform == "win32" (from ipython>=4.0.0->ipykernel->jupyter)
  Using cached win_unicode_console-0.5.zip
Collecting pickleshare (from ipython>=4.0.0->ipykernel->jupyter)
  Using cached pickleshare-0.7.4-py2.py3-none-any.whl
Collecting decorator (from ipython>=4.0.0->ipykernel->jupyter)
  Using cached decorator-4.0.10-py2.py3-none-any.whl
Collecting backports.shutil-get-terminal-size; python_version == "2.7" (from ipython>=4.0.0->ipykernel->jupyter)
  Using cached backports.shutil_get_terminal_size-1.0.0-py2.py3-none-any.whl
Requirement already satisfied: setuptools>=18.5 in c:\python27\lib\site-packages (from ipython>=4.0.0->ipykernel->jupyter)
Collecting pathlib2; python_version == "2.7" or python_version == "3.3" (from ipython>=4.0.0->ipykernel->jupyter)
  Using cached pathlib2-2.2.0-py2.py3-none-any.whl
Collecting simplegeneric>0.8 (from ipython>=4.0.0->ipykernel->jupyter)
  Using cached simplegeneric-0.8.1.zip
Collecting colorama; sys_platform == "win32" (from ipython>=4.0.0->ipykernel->jupyter)
  Using cached colorama-0.3.7-py2.py3-none-any.whl
Collecting enum34; python_version == "2.7" (from traitlets>=4.1.0->ipykernel->jupyter)
  Using cached enum34-1.1.6-py2-none-any.whl
Collecting six (from traitlets>=4.1.0->ipykernel->jupyter)
  Using cached six-1.10.0-py2.py3-none-any.whl
Collecting wcwidth (from prompt-toolkit<2.0.0,>=1.0.0->jupyter-console->jupyter)
  Using cached wcwidth-0.1.7-py2.py3-none-any.whl
Collecting MarkupSafe>=0.23 (from jinja2->nbconvert->jupyter)
  Using cached MarkupSafe-0.23.tar.gz
Collecting html5lib!=0.9999,!=0.99999,<0.99999999,>=0.999 (from bleach->nbconvert->jupyter)
  Using cached html5lib-0.9999999.tar.gz
Collecting jsonschema!=2.5.0,>=2.4 (from nbformat->nbconvert->jupyter)
  Using cached jsonschema-2.5.1-py2.py3-none-any.whl
Collecting configparser>=3.5; python_version == "2.7" (from entrypoints>=0.2.2->nbconvert->jupyter)
  Using cached configparser-3.5.0.tar.gz
Collecting scandir (from pathlib2; python_version == "2.7" or python_version == "3.3"->ipython>=4.0.0->ipykernel->jupyter)
  Using cached scandir-1.4.zip
Exception:
Traceback (most recent call last):
  File "c:\python27\lib\site-packages\pip\basecommand.py", line 215, in main
    status = self.run(options, args)
  File "c:\python27\lib\site-packages\pip\commands\install.py", line 324, in run
    requirement_set.prepare_files(finder)
  File "c:\python27\lib\site-packages\pip\req\req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "c:\python27\lib\site-packages\pip\req\req_set.py", line 620, in _prepare_file
    session=self.session, hashes=hashes)
  File "c:\python27\lib\site-packages\pip\download.py", line 821, in unpack_url
    hashes=hashes
  File "c:\python27\lib\site-packages\pip\download.py", line 663, in unpack_http_url
    unpack_file(from_path, location, content_type, link)
  File "c:\python27\lib\site-packages\pip\utils\__init__.py", line 599, in unpack_file
    flatten=not filename.endswith('.whl')
  File "c:\python27\lib\site-packages\pip\utils\__init__.py", line 499, in unzip_file
    fp = open(fn, 'wb')
IOError: [Errno 22] invalid mode ('wb') or filename: 'c:\\users\\wonhee\\appdata\\local\\temp\\pip-build-o9imsa\\scandir\\test/testdir/subdir/unicod\xc6\x8f.txt

我不知道 errno 22。 请给我一些解决这个问题的方法。谢谢

【问题讨论】:

标签: python-2.7 pip installation jupyter


【解决方案1】:

要在没有二进制包的情况下安装scandir,请使用来自http://www.lfd.uci.edu/~gohlke/的官方二进制包scandir

然后运行(例如)

pip install scandir‑1.5‑cp27‑cp27m‑win32.whl

【讨论】:

    【解决方案2】:

    就我而言,scandir 安装失败是因为我没有安装 python 开发工具

    sudo apt-get install python-dev 
    

    【讨论】:

      【解决方案3】:

      我认为您的主要问题是“scandir”包。 其实我和你有同样的问题,我用下面的方法解决了。

      • 您需要手动安装“scandir”软件包。
        1. 到这里:https://pypi.python.org/pypi/scandir
        2. 下载“scandir-1.4.zip (md5)”并解压
        3. 打开cmd,进入“scandir-1.4”文件夹所在目录
        4. 输入“python setup.py install”
        5. 安装完成后,再次尝试安装jupyter

      干杯。

      【讨论】:

      • 这并不能解决大多数人的原始问题,因为它仍然需要安装 MSVC。你所做的只是 pip 所做的手动版本。
      猜你喜欢
      • 1970-01-01
      • 2021-12-25
      • 2016-05-23
      • 1970-01-01
      • 2020-04-28
      • 1970-01-01
      • 1970-01-01
      • 2020-06-20
      • 2021-12-23
      相关资源
      最近更新 更多