Search code examples
pythonpippython-wheel

How to avoid rebuilding existing wheels when using pip?


With pip 1.5.X, we can use pip wheel to build and cache a wheel of a package, then use --use-wheel with pip install to install from the cached wheel.

I'm trying to use this feature in a environment setup script. This is what I'm trying:

pip wheel --wheel-dir=/tmp Cython==0.19.2
pip install Cython==0.19.2 --use-wheel --no-index --find-links=/tmp

I'm expecting pip wheel to check if the wheel already exists before building it. But it seems to ignore the existing wheel and build every single time.

Is it possible to avoid this?


Solution

  • I've been using the option

        --find-links=/tmp
    

    where /tmp is the wheelhouse. This seems to actually check the wheelhouse and not re-download things. Using your example, try this:

        pip wheel --find-links=/tmp --wheel-dir=/tmp Cython==0.19.2