force pip to build from source (tar.gz), not the wheel (.whl)

Viewed 3039

When installing a package with pip, if available it picks the wheel for fast installation. I, however, would like to force pip to install a package from the source .tar.gz file.(This is to make sure that it links against the correct third-party system libraries.

(If it plays any role, this is about h5py.)

Any hints?

1 Answers

If you have a .tar.gz file you can simply install it with pip:

pip install foobar.tar.gz

Also, see pip option --no-binary in the documentation. Use :all: to force compilation of all packages, or specify a list of packages to compile.

pip install --no-binary :all: foobar
pip install --no-binary numpy,scipy foobar

To install h5py from sources do

pip install --no-binary h5py h5py

This will still use wheels for all other packages that might be installed as a dependency.

Related