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?
Asked
Active
Viewed 157 times
1
-
this is a duplicate of [this](https://stackoverflow.com/questions/5226311/installing-specific-package-versions-with-pip) question – snatchysquid Jun 01 '20 at 18:08
-
Does this answer your question? [Installing specific package versions with pip](https://stackoverflow.com/questions/5226311/installing-specific-package-versions-with-pip) – snatchysquid Jun 01 '20 at 18:08
-
The question is how to instruct pip to use a package that was modified by a user to satisfy the dependencies, not how to install a different version of a package from the repository. – Dmitri Ivanov Jun 01 '20 at 19:15
-
If scikit-learn's only dependency is scipy, you could always pass `--no-deps` when installing it, so it just installs that package, and doesn't try to do anything with the dependencies. – ShadowRanger Jun 04 '20 at 23:16
-
1Thanks, I tried "pip3.7 install scikit-learn --no-deps" but it still kept trying to install the original scipy-1.4.1.tar.gz from the repository for some reason. I ended up just downloading the .tar.gz of the scikit-learn package and running pip3.7 on the downloaded file, and it worked. I think it'd be a nice functionality to have, for pip, where a user could just choose what packages should be used (on a local machine) for satisfying certain dependencies. – Dmitri Ivanov Jun 07 '20 at 18:28
1 Answers
1
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
Either using '--no-build-isolation' in pip install:
pip install scikit-learn --no-build-isolation
.or downloading scikit-learn-0.23.1.tar.gz and building and installing using
python setup.py build
andpython setup.py install
.
These solutions assume that all other packages on which scikit-learn depends have been installed.

Dmitri Ivanov
- 31
- 4