Is there a way to specify the minimum python version required for installing a module in pip?
I am trying to publish a package to pypi.
python setup.py sdist upload -r pypi
Is the command I am using. However in setup.py there is no way to specify that the minimum python version (in my case python 3.5) is needed to run this module.
How do I Install a Specific Version of a Python Package? 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.
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.
The current version of pip works on: Windows, Linux and MacOS. CPython 3.7, 3.8, 3.9, 3.10 and latest PyPy3.
You can specify the version of the python required for your project by using:
python_requires='>=3.5'
The above code must be specified in setup.py
,also only versions 9.0.0 and higher of pip recognize the python_requires
metadata.
Additionally in setup.py
to specify the dependences:
setup(
install_requires=['dependent functions,classes,etc'],
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With