Dmitri Ivanov
Dmitri Ivanov

Reputation: 31

How to instruct python pip to use a user-modified version of a package to satisfy the dependencies for other packages?

Present version of the package scipy-1.4.1 has a compilation bug (on Cygwin) https://github.com/scipy/scipy/issues/11319 that is very easy to fix, which I did. I then recreated the scipy-1.4.1.tar.gz file with the bug fixed on my local machine and ran pip3.7 install /repackaged/on/my/local/machine/scipy-1.4.1.tar.gz. After that I could load scipy from python3.7 with no problems. However when I run pip3.7 install scikit-learn it keeps trying to download and reinstall scipy-1.4.1.tar.gz file from the original repository to satisfy the dependency of scikit-learn on scipy, even though a working up-to-date version of scipy has been installed. Is there a way to tell pip to use your version of the package to satisfy the dependency for another package?

Upvotes: 1

Views: 167

Answers (1)

Dmitri Ivanov
Dmitri Ivanov

Reputation: 31

After downloading scipy-1.4.1.tar.gz, fixing the compilation bug https://github.com/scipy/scipy/issues/11319 and then installing scipy-1.4.1 by running python setup.py build and python setup.py install, the two approaches that get scikit-learn installed without trying to rebuild scipy-1.4.1 from the repository are

  1. Either using '--no-build-isolation' in pip install: pip install scikit-learn --no-build-isolation .

  2. or downloading scikit-learn-0.23.1.tar.gz and building and installing using python setup.py build and python setup.py install .

These solutions assume that all other packages on which scikit-learn depends have been installed.

Upvotes: 1

Related Questions