問題描述
我正在嘗試安裝 MySQL_python
的 1.2.2 版,使用使用 --no-site-packages
選項創(chuàng)建的全新 virtualenv.PyPi 中顯示的當前版本是 1.2.3.有沒有辦法安裝舊版本?我試過了:
I am trying to install version 1.2.2 of MySQL_python
, using a fresh virtualenv created with the --no-site-packages
option. The current version shown in PyPi is 1.2.3. Is there a way to install the older version? I have tried:
pip install MySQL_python==1.2.2
然而,安裝后,它仍然在站點包中顯示MySQL_python-1.2.3-py2.6.egg-info
.這是這個包特有的問題,還是我做錯了什么?
However, when installed, it still shows MySQL_python-1.2.3-py2.6.egg-info
in the site packages. Is this a problem specific to this package, or am I doing something wrong?
推薦答案
TL;DR:
pip install -Iv
(即pip install -Iv MySQL_python==1.2.2
)
首先,我發(fā)現(xiàn)您嘗試執(zhí)行的操作存在兩個問題.由于您已經(jīng)安裝了版本,您應(yīng)該卸載當前現(xiàn)有的驅(qū)動程序或使用 pip install -I MySQL_python==1.2.2
First, I see two issues with what you're trying to do. Since you already have an installed version, you should either uninstall the current existing driver or use pip install -I MySQL_python==1.2.2
但是,您很快就會發(fā)現(xiàn)這行不通.如果您查看 pip 的安裝日志,或者執(zhí)行 pip install -Iv MySQL_python==1.2.2
,您會發(fā)現(xiàn) PyPI URL 鏈接不適用于 MySQL_python v1.2.2.你可以在這里驗證:http://pypi.python.org/pypi/MySQL-python/1.2.2
However, you'll soon find out that this doesn't work. If you look at pip's installation log, or if you do a pip install -Iv MySQL_python==1.2.2
you'll find that the PyPI URL link does not work for MySQL_python v1.2.2. You can verify this here: http://pypi.python.org/pypi/MySQL-python/1.2.2
由于 sourceforge.net 最近的升級和 PyPI 的陳舊 URL,下載鏈接 404 和回退 URL 鏈接無限重定向.
The download link 404s and the fallback URL links are re-directing infinitely due to sourceforge.net's recent upgrade and PyPI's stale URL.
因此要正確安裝驅(qū)動程序,您可以按照以下步驟操作:
So to properly install the driver, you can follow these steps:
pip uninstall MySQL_python
pip install -Iv http://sourceforge.net/projects/mysql-python/files/mysql-python/1.2.2/MySQL-python-1.2.2.tar.gz/download
這篇關(guān)于使用 pip 安裝特定的軟件包版本的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!