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?
If you've installed a Python package using pip , then chances are that a wheel has made the installation faster and more efficient. Wheels are a component of the Python ecosystem that helps to make package installs just work. They allow for faster installations and more stability in the package distribution process.
According to the Python Packaging Authority (PyPA), wheels are the preferred way that pip installs Python modules from the Python Package Index (PyPI) because they're smaller, faster to install, and more efficient than building the package from the source code contained in an sdist.
Pip relies on package authors to stipulate the dependencies for their code in order to successfully download and install the package plus all required dependencies from the Python Package Index (PyPI). But if packages are installed one at a time, it may lead to dependency conflicts.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With