如何使用pip安装特定版本的软件包? [英] How to install a specific version of a package with pip?

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

问题描述

可能重复:
使用Pip安装特定的软件包版本

Possible Duplicate:
Installing specific package versions with Pip

我对pip installvirtualenv有点陌生.

我已经在服务器以及本地开发环境上设置了virtualenv.

I have setup an virtualenv on my server as well as on my local dev environment.

在服务器上,软件包django_modeltranslation-0.4.0_beta2可以正常工作.

On the server the package django_modeltranslation-0.4.0_beta2 works perfectly fine.

但是在我的本地计算机上django_modeltranslation-0.5.0-alpha似乎根本无法正常工作.

However on my local machine django_modeltranslation-0.5.0-alpha doesn't seem to work well at all.

我通常像这样简单地将其安装在virtual-env中:

I usually simply install it in virtual-env like this:

$ source bin/active
(env)$ pip install django_modeltranslation

尽管它获得了最新版本,但现在第一次导致使用最新版本的问题.

This gets the latest version though, which now for the first time causes issues working with latest version.

所以我已经像这样卸载了版本5 alpha:

So I have uninstalled the version 5 alpha like this:

(env)$ pip uninstall django_modeltranslation

但是现在我不知道如何才能再次获得工作版本0.4.0 Beta. 我尝试过,但是找不到:

But now I don't know how I could get the working version 0.4.0 Beta again. I tried this but it couldn't find it:

(env)$ pip install django_modeltranslation-0.4.0_beta2
Downloading/unpacking django-modeltranslation-0.4.0-beta2
  Could not find any downloads that satisfy the requirement django-modeltranslation-0.4.0-beta2
No distributions at all found for django-modeltranslation-0.4.0-beta2

我认为必须有一种方法,因为这是使用虚拟环境的全部要点.

I think there must be a way, since that is the whole point of using virtual env.

推荐答案

使用==:

pip install django_modeltranslation==0.4.0-beta2

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

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