Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find the latest *compatible* version of a Pypi package?

On a production server, I am forced to use python3.2. Sadly several of my dependencies require >=python3.4. Is there a way to find out what the latest version of a package is that can be used with a specific python version?

For instance, with python3.2, what version of numpy should be used?

(This is only an example, answers would ideally not focus on the example, but on the actual question).

like image 660
Private Avatar asked Nov 19 '22 02:11

Private


1 Answers

Perhaps you could use environment markers to solve the problem?

These are strings that can be used in requirements.txt and setup.py files (under the install_requires argument) and look like:

numpy>=1.7,<2; python_version > '3.4'
numpy>=1.7,<1.12; python_version < '3.4'

They can help you match packages to Python versions with some flexibility.

like image 103
Richard Avatar answered Mar 08 '23 06:03

Richard