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

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.

This question is related to python virtualenv pip django-modeltranslation

The answer is


Use ==:

pip install django_modeltranslation==0.4.0-beta2

Examples related to python

programming a servo thru a barometer Is there a way to view two blocks of code from the same file simultaneously in Sublime Text? python variable NameError Why my regexp for hyphenated words doesn't work? Comparing a variable with a string python not working when redirecting from bash script is it possible to add colors to python output? Get Public URL for File - Google Cloud Storage - App Engine (Python) Real time face detection OpenCV, Python xlrd.biffh.XLRDError: Excel xlsx file; not supported Could not load dynamic library 'cudart64_101.dll' on tensorflow CPU-only installation

Examples related to virtualenv

How to setup virtual environment for Python in VS Code? Conda version pip install -r requirements.txt --target ./lib What is the purpose of "pip install --user ..."? What is the difference between venv, pyvenv, pyenv, virtualenv, virtualenvwrapper, pipenv, etc? ImportError: No module named 'encodings' how to specify new environment location for conda create Use virtualenv with Python with Visual Studio Code in Ubuntu Is it ok having both Anacondas 2.7 and 3.5 installed in the same time? How to uninstall a package installed with pip install --user Unable to install boto3

Examples related to pip

How to fix error "ERROR: Command errored out with exit status 1: python." when trying to install django-heroku using pip "E: Unable to locate package python-pip" on Ubuntu 18.04 How to Install pip for python 3.7 on Ubuntu 18? What is the meaning of "Failed building wheel for X" in pip install? Could not install packages due to an EnvironmentError: [Errno 13] How do I install Python packages in Google's Colab? Conda version pip install -r requirements.txt --target ./lib pip: no module named _internal AttributeError: Module Pip has no attribute 'main' Error after upgrading pip: cannot import name 'main'

Examples related to django-modeltranslation

How to install a specific version of a package with pip?