0

I am using a python package that requires a .whl package to get pip installed.

However, each operating system has it's own .whl file.

Examples

  • linux: PyAAF-1.0.0-cp27-cp27m-manylinux1_x86_64.whl
  • mac: PyAAF-1.0.0-cp27-none-macosx_10_6_intel.whl

Is there a way to set my requirements.txt file choose the correct .whl file according to the currently-running OS?

Thanks

Harsha Biyani
  • 7,049
  • 9
  • 37
  • 61
  • 1
    Possible duplicate of [Is there a way to have a conditional requirements.txt file for my Python application based on platform?](https://stackoverflow.com/questions/29222269/is-there-a-way-to-have-a-conditional-requirements-txt-file-for-my-python-applica) – eiram_mahera Feb 13 '18 at 07:18

1 Answers1

0

When you install packages with pip it will automatically set the wheels that your operating system supports. So just type:

pip install PackagName

In order to install the package. Make sure to not include the version nor the plataform. So if you want to install the latest numpy wheel (numpy-1.14.0-cp27-cp27m-manylinux1_i686.whl) you have to type:

pip install numpy

And the package will be automatically downloaded from Pypi

Note if you want to know which wheel formats your os supports you can open a python console and execute the following code:

import pip; print(pip.pep425tags.get_supported())
pokoli
  • 1,045
  • 7
  • 15