【问题标题】:Install IPython from PyPi mirrors with pip使用 pip 从 PyPi 镜像安装 IPython
【发布时间】:2017-09-01 08:54:36
【问题描述】:

我想用 PyPi 镜像(我们公司的镜像)加速下载 Python 包,但是 pip 无法从镜像中选择正确的 iPython 版本。我猜这个问题可能与 PyPi 索引数据库有关。如果有人知道这个问题,欢迎告诉我。

Python 版本:

(p2) ➜  /tmp python --version
Python 2.7.13

这是我的 ~/.pip/pip.conf

[global]
index-url = http://mirrors.company.com/pypi/simple/
trusted-host=mirrors.company.com

当我使用pip install ipython时,打印出以下错误信息

(p2) ➜  /tmp pip install ipython
Collecting ipython
  Downloading http://mirrors.aliyun.com/pypi/packages/79/63/b671fc2bf0051739e87a7478a207bbeb45cfae3c328d38ccdd063d9e0074/ipython-6.1.0.tar.gz (5.1MB)
    100% |████████████████████████████████| 5.1MB 7.6MB/s
    Complete output from command python setup.py egg_info:

    IPython 6.0+ does not support Python 2.6, 2.7, 3.0, 3.1, or 3.2.
    When using Python 2.7, please install IPython 5.x LTS Long Term Support version.
    Beginning with IPython 6.0, Python 3.3 and above is required.

    See IPython `README.rst` file for more information:

        https://github.com/ipython/ipython/blob/master/README.rst

    Python sys.version_info(major=2, minor=7, micro=13, releaselevel='final', serial=0) detected.



    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/6c/gbrkbbzd4gvdp56x7x8s6xpw0000gn/T/pip-build-FVITyR/ipython/ 

【问题讨论】:

    标签: python pip ipython pypi


    【解决方案1】:

    您的代理/镜像未正确实现pep503,并且您的 pip 可能已过时(您需要 pip 9.0.1+)。由于December 2016 PyPI 已被修复以正确公开额外的元数据,告诉 Pip 与哪个 Python 版本兼容(My talk at PyConPyBay 今年关于此)。

    可以肯定的是,在 PyPI 上查看这个页面,你可以在源代码中看到 IPython 6.0.0 的链接:

    <a data-requires-python="&gt;=3.3" href="../../packages/.../ipython-6.0.0.tar.gz" >ipython-6.0.0.tar.gz</a><br/>
    

    现在检查 same page on your mirror... 它缺少 data-requires-python="&amp;gt;=3.3" 字段,因此 pip 无法知道 IPython 6.0 不兼容。我建议联系运行镜像的人以更新它。

    另外请将您的镜像设置为只允许 https,否则您将不确定您正在下载的内容是否被篡改!

    【讨论】:

    • 谢谢,我会联系人家的。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-08-16
    • 2013-05-04
    • 2019-10-28
    • 2021-12-25
    • 2017-11-23
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多