How to install a specific version of a package with pip? [duplicate]

谁都会走 提交于 2019-11-26 22:20:05

问题


Possible Duplicate:
Installing specific package versions with Pip

I am a bit new to pip install and virtualenv in general.

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

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

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

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.

So I have uninstalled the version 5 alpha like this:

(env)$ pip uninstall django_modeltranslation

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.


回答1:


Use ==:

pip install django_modeltranslation==0.4.0-beta2


来源:https://stackoverflow.com/questions/13916820/how-to-install-a-specific-version-of-a-package-with-pip

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!