2017-09-01 50 views
2

我想用PyPi鏡像(我們的公司鏡像)加速下載Python包,但是pip無法從鏡像中選擇正確的iPython版本。我猜這個問題可能與PyPi索引數據庫有關係。如果有人知道這個問題,歡迎告訴我。用PyPi鏡像安裝IPython用pip

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/ 

回答

2

你代理/鏡像沒有正確實現pep503,您的點可能已過期(您需要d點子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="&gt;=3.3"場,所以點不知道IPython 6.0是不兼容的。我建議聯繫運行鏡像的人來更新它。

也請設置您的鏡像只允許HTTPS,否則你將不能確定你下載的內容沒有被篡改!

+0

謝謝,我會聯繫的人。 – runitao