如何使用 pip 安装特定版本的软件包? [英] How to install a specific version of a package with pip?
问题描述
可能的重复:
使用 Pip 安装特定的软件包版本
总的来说,我对 pip install
和 virtualenv
有点陌生.
I am a bit new to pip install
and virtualenv
in general.
我已经在我的服务器以及我的本地开发环境中设置了一个 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屋!