Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Pip: Specifying minor version

In my requirements.txt file I want to specify that my app needs Django version 1.3.x. That is, either 1.3.0, or 1.3.1, or 1.3.2, etc. (When these come out.) But not 1.4, when it comes out.

What's the syntax for this?

like image 477
Ram Rachum Avatar asked May 18 '11 16:05

Ram Rachum


People also ask

How do I specify pip version?

To install a specific version of a Python package you can use pip: pip install YourPackage==YourVersion . For example, if you want to install an older version of Pandas you can do as follows: pip install pandas==1.1. 3 .

How does pip decide which version to install?

Once pip has a list of compatible distributions, it sorts them by version, chooses the most recent version, and then chooses the "best" distribution for that version. It prefers binary wheels if there are any, and if they are multiple it chooses the one most specific to the install environment.

Which operator helps to install version 1.0 2 of some package?

You can use pip install --upgrade SomePackage to upgrade to a newer version, or pip install SomePackage==1.0.

Does pip update requirements txt?

this will automatically upgrade all packages from requirements. txt (make sure to install pip-tools using pip install command). Pip-tools is working great -- updated syntax is pip-compile -U requirements. txt .


1 Answers

According to Ian Bicking:

Django>=1.3,<1.4 

However, it's apparently safer to do:

Django>=1.3,<1.3.99 
like image 126
quasistoic Avatar answered Sep 18 '22 22:09

quasistoic