每次我尝试使用pip安装软件包时,都会显示错误

时间:2018-06-23 09:24:17

标签: python-3.x

安装jupyter笔记本。每次发生相同的错误。如果我也安装任何其他软件包,则错误是相同的。我目前正在使用最新的python 3.6.5版本。我最近下载了python,我的Windows版本是10。

>pip install jupyter
Collecting jupyter
  Using cached https://files.pythonhosted.org/packages/83/df/0f5dd132200728a86190397e1ea87cd76244e42d39ec5e88efd25b2abd7e/jupyter-1.0.0-py2.py3-none-any.whl
Collecting ipywidgets (from jupyter)
  Using cached https://files.pythonhosted.org/packages/7d/24/fabc09ad81c6071159a4d12d5bfbddcbea69bd9e3b16c3250ef300c0285f/ipywidgets-7.2.1-py2.py3-none-any.whl
Collecting ipykernel (from jupyter)
  Using cached https://files.pythonhosted.org/packages/ab/3f/cd624c835aa3336a9110d0a99e15070f343b881b7d651ab1375ef226a3ac/ipykernel-4.8.2-py3-none-any.whl
Collecting notebook (from jupyter)
  Using cached https://files.pythonhosted.org/packages/c0/66/cfed59f574d03ca5f1b7c5281485a9cc9a0f21342d24e0f057572316dae5/notebook-5.5.0-py2.py3-none-any.whl
Collecting jupyter-console (from jupyter)
  Using cached https://files.pythonhosted.org/packages/77/82/6469cd7fccf7958cbe5dce2e623f1e3c5e27f1bb1ad36d90519bc2d5d370/jupyter_console-5.2.0-py2.py3-none-any.whl
Collecting qtconsole (from jupyter)
  Using cached https://files.pythonhosted.org/packages/90/ff/047e0dca2627b162866920e7aa93f04523c0ae81e5c67060eec85701992d/qtconsole-4.3.1-py2.py3-none-any.whl
Collecting nbconvert (from jupyter)
  Using cached https://files.pythonhosted.org/packages/39/ea/280d6c0d92f8e3ca15fd798bbcc2ea141489f9539de7133d8fe10ea4b049/nbconvert-5.3.1-py2.py3-none-any.whl
Collecting widgetsnbextension~=3.2.0 (from ipywidgets->jupyter)
  Using cached https://files.pythonhosted.org/packages/ff/fa/64acc09fc845a6b2dc0724d6f3f81e829b778ed5e9a7559567b4f19a3f4b/widgetsnbextension-3.2.1-py2.py3-none-any.whl
Collecting ipython>=4.0.0; python_version >= "3.3" (from ipywidgets->jupyter)
  Using cached https://files.pythonhosted.org/packages/b1/7f/91d50f28af3e3a24342561983a7857e399ce24093876e6970b986a0b6677/ipython-6.4.0-py3-none-any.whl
Collecting nbformat>=4.2.0 (from ipywidgets->jupyter)
  Using cached https://files.pythonhosted.org/packages/da/27/9a654d2b6cc1eaa517d1c5a4405166c7f6d72f04f6e7eea41855fe808a46/nbformat-4.4.0-py2.py3-none-any.whl
Collecting traitlets>=4.3.1 (from ipywidgets->jupyter)
  Using cached https://files.pythonhosted.org/packages/93/d6/abcb22de61d78e2fc3959c964628a5771e47e7cc60d53e9342e21ed6cc9a/traitlets-4.3.2-py2.py3-none-any.whl
Collecting jupyter-client (from ipykernel->jupyter)
  Using cached https://files.pythonhosted.org/packages/94/dd/fe6c4d683b09eb05342bd2816b7779663f71762b4fa9c2d5203d35d17354/jupyter_client-5.2.3-py2.py3-none-any.whl
Collecting tornado>=4.0 (from ipykernel->jupyter)
  Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001F5B1BF66D8>, 'Connection to files.pythonhosted.org timed out. (connect timeout=15)')': /packages/3d/4a/5b321dc86dec06205cfae8e06fd9fa78be57e199b8665dc152c56f7d5b53/tornado-5.0.2-cp36-cp36m-win_amd64.whl
  Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001F5B1CF3A20>, 'Connection to files.pythonhosted.org timed out. (connect timeout=15)')': /packages/3d/4a/5b321dc86dec06205cfae8e06fd9fa78be57e199b8665dc152c56f7d5b53/tornado-5.0.2-cp36-cp36m-win_amd64.whl
  Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001F5B1CF3A90>, 'Connection to files.pythonhosted.org timed out. (connect timeout=15)')': /packages/3d/4a/5b321dc86dec06205cfae8e06fd9fa78be57e199b8665dc152c56f7d5b53/tornado-5.0.2-cp36-cp36m-win_amd64.whl
  Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001F5B1CF3E10>, 'Connection to files.pythonhosted.org timed out. (connect timeout=15)')': /packages/3d/4a/5b321dc86dec06205cfae8e06fd9fa78be57e199b8665dc152c56f7d5b53/tornado-5.0.2-cp36-cp36m-win_amd64.whl
  Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001F5B1CF3AC8>, 'Connection to files.pythonhosted.org timed out. (connect timeout=15)')': /packages/3d/4a/5b321dc86dec06205cfae8e06fd9fa78be57e199b8665dc152c56f7d5b53/tornado-5.0.2-cp36-cp36m-win_amd64.whl
Could not install packages due to an EnvironmentError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Max retries exceeded with url: /packages/3d/4a/5b321dc86dec06205cfae8e06fd9fa78be57e199b8665dc152c56f7d5b53/tornado-5.0.2-cp36-cp36m-win_amd64.whl (Caused by ConnectTimeoutError(<pip._vendor.urllib3.connection.VerifiedHTTPSConnection object at 0x000001F5B1CF38D0>, 'Connection to files.pythonhosted.org timed out. (connect timeout=15)'))

4 个答案:

答案 0 :(得分:2)

与pip无关,这是您的防火墙/网络错误。尝试允许python3.exe通过防火墙,然后以管理员身份运行终端。我刚刚在我的终端上运行pip install jupyter,它安装完美。

还用以下方式更新您的点值

python.exe -m pip install --upgrade pip

另外,运行

ping files.pythonhosted.org

在您的终端中以确保可以连接

答案 1 :(得分:1)

感谢帮助人员。我这是一个愚蠢的错误。我不小心弄乱了我的PATH变量。 我改正路径后,现在一切正常。 :) 非常感谢!

答案 2 :(得分:0)

这似乎是pip的已知问题。参见https://github.com/pypa/pip/issues/5309

我建议您安装Anaconda,它将处理所有这些依赖项。它预装了jupyter和其他一些python库,例如numpypandas

答案 3 :(得分:0)

我可以使用以下方法安装软件包: pip install --trusted-host pypi.org --trusted-host files.pythonhosted.org <package_name>

根据此回复:https://stackoverflow.com/a/29751768/6398487