使用pip安装特定的软件包版本 [英] Installing specific package versions with pip

查看:99
本文介绍了使用pip安装特定的软件包版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用通过--no-site-packages选项创建的全新virtualenv安装MySQL_python适配器的1.2.2版本. PyPi中显示的当前版本为 1.2.3 .有没有安装旧版本的方法?我发现有一篇文章指出应该这样做:

I'm trying to install version 1.2.2 of the MySQL_python adaptor, 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 found an article stating that this should do it:

pip install MySQL_python==1.2.2

但是,安装后,它仍在站点软件包中显示MySQL_python-1.2.3-py2.6.egg-info.这是此软件包专用的问题,还是我做错了什么?

When installed, however, 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)

首先,我发现您要执行的操作有两个问题.由于已经安装了版本,因此应该卸载当前的现有驱动程序或使用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

但是,您很快就会发现这不起作用.如果查看pip的安装日志,或者执行pip install -Iv MySQL_python==1.2.2,您会发现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,下载链接404s和后备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.

因此,要正确安装驱动程序,可以按照以下步骤操作:

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

这篇关于使用pip安装特定的软件包版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆