Skip to content
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

Bug: Scikit-image 0.14.1 broken with numpy 1.16 #3586

Closed
abhiTronix opened this issue Dec 11, 2018 · 30 comments
Closed

Bug: Scikit-image 0.14.1 broken with numpy 1.16 #3586

abhiTronix opened this issue Dec 11, 2018 · 30 comments

Comments

@abhiTronix
Copy link

Bug Description

Latest Numpy commit numpy/numpy#11966 (comment) removed _validate_lengths and other functions from numpy.lib.arraypad hence brokes the latest scikit-image binaries.

System Information:

  • Operating system: Ubuntu 18.04 LTS
  • Python version: Python 3.6.7
  • scikit-image version : Latest(0.14.1)

Way to reproduce

Python 3.6.7 (default, Oct 22 2018, 11:32:17) 
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import skimage
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/dist-packages/skimage/__init__.py", line 167, in <module>
    from .util.dtype import (img_as_float32,
  File "/usr/local/lib/python3.6/dist-packages/skimage/util/__init__.py", line 8, in <module>
    from .arraycrop import crop
  File "/usr/local/lib/python3.6/dist-packages/skimage/util/arraycrop.py", line 8, in <module>
    from numpy.lib.arraypad import _validate_lengths
ImportError: cannot import name '_validate_lengths'
>>> from numpy.lib.arraypad import _validate_lengths
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name '_validate_lengths'
>>> 
@hmaarrfk
Copy link
Member

Thanks for the report. I think this was fixed recently in master

#3556

And backported to the 0.14 branch.

@hmaarrfk
Copy link
Member

I don’t know how others feel about this, but I think issues should really be closed when the problem is solved for the end user.

People installing scikit image will continue to have a broken install until .14.2 is release.

@stefanv
Copy link
Member

stefanv commented Dec 11, 2018

Users can probably find closed issues as well, and see that it has been fixed in development? It's probably about time to release .14.2 though, you're right.

@tw255
Copy link

tw255 commented Jan 4, 2019

how can i fix this issue? Or do we just wait for the new patch?

@hmaarrfk
Copy link
Member

hmaarrfk commented Jan 4, 2019

what distribution are you using? who is packaging 1.16 today?

@hmaarrfk
Copy link
Member

hmaarrfk commented Jan 4, 2019

@thisisit1212 In either case, if you must be on numpy 1.16 before 0.14.2 gets released on pypi, conda-forge actually has the package with the relevant patches applied.

See recipe here:
https://github.com/conda-forge/scikit-image-feedstock/blob/master/recipe/meta.yaml#L10

You can take the patches you need from there and patch 0.14.1 if you need to cut your own release with minimal differences with 0.14.1.

@tw255
Copy link

tw255 commented Jan 4, 2019

How would I go about doing what you mentioned? sorry im new to programming

@hmaarrfk
Copy link
Member

hmaarrfk commented Jan 4, 2019

@thisisit1212 thats great that you are getting into programming with python + scikit-image!!! I think they are great libraries.

As there are many ways to install python, explain to you how to install "non-standard" software isn't a trivial task without more details.

Can you please explain to me:

  1. What operating system you are using.
  2. How did you install python
  3. How did you install scikit-image
  4. How did you install numpy?

Finally, if you can, using python, run the following two lines of code and give me the output:

import numpy as np
print(np.__version__)

@tw255
Copy link

tw255 commented Jan 4, 2019

Im so sorry for the trouble I just realized I was using numpy 1.16 for whatever reason. I just downloaded 1.15.4 and it works fine now. Thanks!

@hmaarrfk
Copy link
Member

hmaarrfk commented Jan 4, 2019

Right, today, you have to try and download numpy 1.16. In a few weeks, you might not have to. That is why I was surprised that it happened to you.

@sk1p
Copy link

sk1p commented Jan 14, 2019

FYI numpy 1.16 was just released, so right now if you create a new virtualenv and install via pip install scikit-image, you get incompatible versions.

@hmaarrfk
Copy link
Member

I wish there was a sad face. Unfortunately, many libraries (other than scikit image too!!!) will need time to get tested and released with numpy 1.16. I suggest that you wait a little but before jumping on.

@stefanv
Copy link
Member

stefanv commented Jan 14, 2019 via email

@Borda
Copy link
Contributor

Borda commented Jan 16, 2019

Could it be as a fast hotfix for 0.14.Xr? otherwise, it breaks most automatic builds without a fixed package version and pushes users to ban 0.14.1 (not sure if it appears in other image versions)

@stefanv
Copy link
Member

stefanv commented Jan 16, 2019

I'll trigger the process today.

Update: release is underway.

@himmelmaus
Copy link

Any update on when this will be released on PyPi? I have scikit-image .14.1 and numpy 1.16.0 but I still receive the same error (running macOS high sierra and python 3.6.3)

@jni
Copy link
Member

jni commented Jan 17, 2019

@findoslice Sorry, we are seeing build errors on Travis that we are still getting to the bottom of...

As a temporary workaround, you can monkey-patch your version of scikit-image. The import error points to a file called arraycrop.py in your filesystem. You can replace it with this one:
https://github.com/sciunto/scikit-image/blob/eb8c1966eba5639dd4917491aa1b02c74bca56d7/skimage/util/arraycrop.py

@Borda
Copy link
Contributor

Borda commented Jan 17, 2019

or force being numpy<1.16.0

@himmelmaus
Copy link

Thanks guys, I handled it using numpy == 1.15.0 I was just wondering as it took me a while to find it

@hmaarrfk
Copy link
Member

i wouldn't pin to 1.15.0 it was pretty buggy. 1.15.3 or 1.15.4 are pretty good

@mpapadem
Copy link

mpapadem commented Feb 8, 2019

Hi all! I have been having the same problem as described above and using numpy 1.16.0

Although a data modelling geek, my computer science skills are still developing......How do I go back to a previous version of numpy , say 1.15.5 as suggested above?

I am using Windows (I know.......still on windows...., switching into linux soon), and have Anaconda

@soupault
Copy link
Member

soupault commented Feb 8, 2019

@mpapadem try to execute conda install numpy=1.15.4 in your conda environment.

@mpapadem
Copy link

mpapadem commented Feb 8, 2019

@soupault thanks! it s done. But now I get a different error....:

ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'

@soupault
Copy link
Member

soupault commented Feb 8, 2019

@mpapadem maybe try alpacahq/pylivetrader#73 (comment)? If it doesn't help, I'd suggest you to Google a bit more to see if there are any alternative solutions. From what I see, the issue isn't connected to scikit-image anymore.

@hmaarrfk
Copy link
Member

hmaarrfk commented Feb 8, 2019

@mpapadem, this original issue was quite specific to a bug we had in the code base. I suspect you are facing a different issue if you are still hitting issues.

Please open a new issue so we can give you more targeted help.

Since you have quite a unique setup, please share the outputs of

conda list
pip list

when you open that new issue.

@hmaarrfk hmaarrfk changed the title Bug: Scikit-image broken with Latest Numpy binaries Bug: Scikit-image 0.14.1 broken with numpy 1.16 Feb 8, 2019
@claudefalbriard
Copy link

Current pip upgrade of skimage updates Numpy to version 1.16.1. and Scikit-Image 0.14.2 is still broken with error message: ImportError: cannot import name 'img_as_float32'
Thanks for checking.

@stefanv
Copy link
Member

stefanv commented Feb 14, 2019

@claudefalbriard You may have a different problem from the rest; please submit a new issue, filling out the template provided.

@hmaarrfk
Copy link
Member

@scikit-image/core should we close this issue to encourage others to open a new one?

@claudefalbriard
Copy link

Sorry, my fault! Its OK. This error was caused by a missing restart of the Anaconda runtime environment. The skimage upgrade via pip worked perfectly and the samples are working OK now. Thanks.

@hmaarrfk
Copy link
Member

i wouldn't recommend installing scikit-image via pip on anaconda.'
Why do you need to install it that way?

@scikit-image scikit-image locked as resolved and limited conversation to collaborators Feb 14, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests