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.
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
:Similarly, in a
setup.py
:In the end, adding the OS check in the setup.py is what I've found other people using. Ex:
link to full setup.py with example code