-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pip install fails under Python 3.9 if numpy isn't already installed #5060
Comments
Thanks for reporting this. I believe this problem (using numpy in our setup.py before numpy is installed) is a bug which has been fixed since 0.17.2 (in #4920, see in particular https://github.com/scikit-image/scikit-image/blob/master/setup.py#L167). @scikit-image/core should we backport #4920 (or part of it) to 0.17.3? |
IMO: I don't think a 0.17.3 will happen. I think release a 0.18 package will be able to solve this particular challenge. |
We had discussed with @jni whether to release 0.17.3 just before 0.18 but I'm not 100% sure whether this will happen. 0.18 would also work of course. |
I don't understand how #4920 is supposed to resolve this issue. Everything in setup.py below line 14 Line 14 in 79cb22a
numpy by that point.
#4920 put Does this mean that numpy needs to be installed before attempting to install scikit-image? If so, this still makes it impossible to install numpy and scikit-image together in a single requirements.txt file. This pre-installation requirement is not documented on the readme. |
NumPy is a build dependency of scikit-image, so you cannot run scikit-image's setup.py without it. However, if you install scikit-image from wheel (as you typically do when specifying The build requirements are documented here: https://scikit-image.org/docs/dev/install.html#full-requirements-list |
python 3.9 was release Oct 2020. I somewhat remember this as being related to an early adopter getting stuck compiling bumpy from sdist. I believe that the mentioned PRs (and subsequent releases) resolved the issue today. I do not anticipate the same issue for 3.10. though we should likely try to start releasing wheels for it. |
@hmaarrfk I can indeed confirm that I was trying to adopt Python 3.9 quite early (foolishly early, some might say). |
We could also fail more gracefully in setup.py when numpy.distutils cannot be imported. |
@emmanuelle Says there are no wheels for Python 3.9 and the PyPI page says scikit-learn requires Python >= 3.8. Given this, I tried Side note: the docs linked by @stefanv seem to be out-of-date since they say Python >= 3.6 EDIT: noted the specific version of scikit-learn that was attempted |
I'm sorry for not closing this issue before hand. We really should have 1 year ago. It is just hard to do so without getting confirmation from the end user that their issues have been resolved. I feel like your challenges in, 2022, are quite different than those in 2020. We would be happy to help but we do require more information from you. We request it when you try to open a new issue. It really helps! To answer your specific questions:
When you open a new issue, you will have a chance to tell us about your operaitng system and hardware. those are really important to know when you try to install software. |
Ah good to know the "files" page on PyPI, thanks! I had been trying scikit-image 0.19.2 with Python 3.8.12, and looking at the list the latest supported is Python 3.7, so that makes sense why it couldn't find any Ultimately, 0.19.2 is extremely outdated (I only tried it because Yolo V7 has it pinned in their requirements.txt). I ended up using the latest 1.1.2 which has many options available for wheels |
@addisonklinke I think you've mistaken us (scikit-image) for our friends at scikit-learn... 😄 |
Description
Installing scikit-learn via pip on linux under Python 3.9 fails if numpy is not already installed. This makes it impossible (or at least much harder) to use in requirements.txt files when creating virtual environments or docker containers.
Way to reproduce
Start with a clean virtual envoronment
python -m venv .env . .env/bin/activate pip install scikit-image
Results in the following error:
I have also tried pinning the version to 0.17.1 and 0.16.2, which doesn't work either. Running
pip install numpy scikit-learn
also fails, to make it succeed, they must be run separately:pip install numpy && pip install scikit-image
.Version information
The text was updated successfully, but these errors were encountered: