Is it possible to have OS specific requirements in pip's requirements.txt file?
For example: I have a dependency on readline, therefore, if installing on windows (or OSX), then pyreadline is a requirement. If it's linux, then I don't want to force an install.
Use the pip install -r requirements. txt command to install all of the Python modules and packages listed in your requirements. txt file. This saves time and effort.
You must give at least one requirement to install (see "pip help install") You are using pip version 9.0. 1, however version 9.0. 3 is available. You should consider upgrading via the 'python -m pip install --upgrade pip' command.
You can do this with "Environment Markers" as specified in PEP-508:
Here's an example of using such a marker inside a requirements.txt
:
pyreadline==2.1; platform_system == "Windows"
Similarly, in a setup.py
:
setup(
...
install_requires=['pyreadline; platform_system == "Windows"'],
)
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