In pip>=6You can do this by using the "markers of the environment", as defined in the PEP-496 :
Here are some examples of such markers in the require.txt file:
pywin32 >=1.0 ; sys_platform == 'win32'
unittest2 >=2.0,<3.0 ; python_version == '2.4' or python_version == '2.5'
backports.ssl_match_hostname >= 3.4 ; python_version < '2.7.9' or (python_version >= '3.0' and python_version < '3.4')
, setup.py , PyWin32 , Windows:
setup(
install_requires=["pywin32 > 1.0 : sys.platform == 'win32'"],
setup_requires=["pywin32 > 1.0 : sys.platform == 'win32'"]
)