When installing numpy==0.16.0 and scikit-image==0.14.1 into the same environment, there appears to be an incompatibility that prevents scikit-image from importing successfully.
mattbΒ ξ°Β ~Β ξ°Β conda create -n deleteme python=3 -y
[...]
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use:
# > source activate deleteme
#
# To deactivate an active environment, use:
# > source deactivate
#
Β mattbΒ ξ°Β ~Β ξ°Β . activate deleteme
Β mattbΒ ξ°Β (e)Β deletemeΒ ξ°Β ~Β ξ°Β pip install scikit-image==
Looking in indexes: https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-virtual/simple, https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-snapshot-local/simple
Collecting scikit-image==
Could not find a version that satisfies the requirement scikit-image== (from versions: 0.7.2, 0.8.0, 0.8.1, 0.8.2, 0.9.0, 0.9.1, 0.9.3, 0.10.0, 0.10.1, 0.11.2, 0.11.3, 0.12.0, 0.12.1, 0.12.2, 0.12.3, 0.13.0, 0.13.1, 0.14.0, 0.14.1)
No matching distribution found for scikit-image==
Β mattbΒ ξ°Β (e)Β deletemeΒ ξ°Β ~Β ξ°Β 1Β ξ°Β pip install numpy
Looking in indexes: https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-virtual/simple, https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-snapshot-local/simple
Collecting numpy
Downloading https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-virtual/packages/3d/10/62224c551acfd3a3583ad16d1e0f1c9e9c333e74479dc51977c31836119c/numpy-1.16.0-cp37-cp37m-manylinux1_x86_64.whl (17.3MB)
100% |ββββββββββββββββββββββββββββββββ| 17.3MB 3.7MB/s
Installing collected packages: numpy
Successfully installed numpy-1.16.0
Β mattbΒ ξ°Β (e)Β deletemeΒ ξ°Β ~Β ξ°Β pip install scikit-image
Looking in indexes: https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-virtual/simple, https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-snapshot-local/simple
Collecting scikit-image
Downloading https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-virtual/packages/bc/b3/d294429adcc4aff0372208494f0f0625f1112428e56070e47bf2cd055579/scikit_image-0.14.1-cp37-cp37m-manylinux1_x86_64.whl (25.3MB)
100% |ββββββββββββββββββββββββββββββββ| 25.3MB 1.4MB/s
Collecting pillow>=4.3.0 (from scikit-image)
Downloading https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-virtual/packages/ae/2a/0a0ab2833e5270664fb5fae590717f867ac6319b124160c09f1d3291de28/Pillow-5.4.1-cp37-cp37m-manylinux1_x86_64.whl (2.0MB)
100% |ββββββββββββββββββββββββββββββββ| 2.0MB 30.3MB/s
Collecting scipy>=0.17.0 (from scikit-image)
Downloading https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-virtual/packages/80/39/066ecde98f373430bf7a39a02d91c7075b01ef4fc928456e8e31577342d6/scipy-1.2.0-cp37-cp37m-manylinux1_x86_64.whl (26.6MB)
100% |ββββββββββββββββββββββββββββββββ| 26.6MB 1.7MB/s
Collecting six>=1.10.0 (from scikit-image)
Downloading https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-virtual/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Collecting PyWavelets>=0.4.0 (from scikit-image)
Downloading https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-virtual/packages/eb/38/210cf3c704be7f2706ea1397fbe2eeae4f88d791175918455daa65043b21/PyWavelets-1.0.1-cp37-cp37m-manylinux1_x86_64.whl (4.4MB)
100% |ββββββββββββββββββββββββββββββββ| 4.4MB 7.9MB/s
Collecting networkx>=1.8 (from scikit-image)
Collecting cloudpickle>=0.2.1 (from scikit-image)
Downloading https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-virtual/packages/fc/87/7b7ef3038b4783911e3fdecb5c566e3a817ce3e890e164fc174c088edb1e/cloudpickle-0.6.1-py2.py3-none-any.whl
Collecting matplotlib>=2.0.0 (from scikit-image)
Downloading https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-virtual/packages/e7/f9/5377596cb1c035c102396f5934237a046f80da69974026f90bee5db8b7ba/matplotlib-3.0.2-cp37-cp37m-manylinux1_x86_64.whl (12.9MB)
100% |ββββββββββββββββββββββββββββββββ| 12.9MB 6.1MB/s
Collecting dask[array]>=0.9.0 (from scikit-image)
Downloading https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-virtual/packages/b4/e5/6407c2349622699eab0881e6bc6e978b8da67872a105e5e20b72ff190c65/dask-1.0.0-py2.py3-none-any.whl (685kB)
100% |ββββββββββββββββββββββββββββββββ| 686kB 29.8MB/s
Requirement already satisfied: numpy>=1.8.2 in ./programs/anaconda3/envs/deleteme/lib/python3.7/site-packages (from scipy>=0.17.0->scikit-image) (1.16.0)
Collecting decorator>=4.3.0 (from networkx>=1.8->scikit-image)
Downloading https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-virtual/packages/bc/bb/a24838832ba35baf52f32ab1a49b906b5f82fb7c76b2f6a7e35e140bac30/decorator-4.3.0-py2.py3-none-any.whl
Collecting pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 (from matplotlib>=2.0.0->scikit-image)
Downloading https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-virtual/packages/de/0a/001be530836743d8be6c2d85069f46fecf84ac6c18c7f5fb8125ee11d854/pyparsing-2.3.1-py2.py3-none-any.whl (61kB)
100% |ββββββββββββββββββββββββββββββββ| 71kB 27.8MB/s
Collecting python-dateutil>=2.1 (from matplotlib>=2.0.0->scikit-image)
Downloading https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-virtual/packages/74/68/d87d9b36af36f44254a8d512cbfc48369103a3b9e474be9bdfe536abfc45/python_dateutil-2.7.5-py2.py3-none-any.whl (225kB)
100% |ββββββββββββββββββββββββββββββββ| 235kB 48.7MB/s
Collecting kiwisolver>=1.0.1 (from matplotlib>=2.0.0->scikit-image)
Downloading https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-virtual/packages/5c/7e/d6cae2f241ba474a2665f24b480bf4e247036d63939dda2bbc4d2ee5069d/kiwisolver-1.0.1-cp37-cp37m-manylinux1_x86_64.whl (89kB)
100% |ββββββββββββββββββββββββββββββββ| 92kB 24.3MB/s
Collecting cycler>=0.10 (from matplotlib>=2.0.0->scikit-image)
Downloading https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-virtual/packages/f7/d2/e07d3ebb2bd7af696440ce7e754c59dd546ffe1bbe732c8ab68b9c834e61/cycler-0.10.0-py2.py3-none-any.whl
Collecting toolz>=0.7.3; extra == "array" (from dask[array]>=0.9.0->scikit-image)
Requirement already satisfied: setuptools in ./programs/anaconda3/envs/deleteme/lib/python3.7/site-packages (from kiwisolver>=1.0.1->matplotlib>=2.0.0->scikit-image) (40.6.3)
Installing collected packages: pillow, scipy, six, PyWavelets, decorator, networkx, cloudpickle, pyparsing, python-dateutil, kiwisolver, cycler, matplotlib, toolz, dask, scikit-image
Successfully installed PyWavelets-1.0.1 cloudpickle-0.6.1 cycler-0.10.0 dask-1.0.0 decorator-4.3.0 kiwisolver-1.0.1 matplotlib-3.0.2 networkx-2.2 pillow-5.4.1 pyparsing-2.3.1 python-dateutil-2.7.5 scikit-image-0.14.1 scipy-1.2.0 six-1.12.0 toolz-0.9.0
Β mattbΒ ξ°Β (e)Β deletemeΒ ξ°Β ~Β ξ°Β python -c "import skimage"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/mattb/programs/anaconda3/envs/deleteme/lib/python3.7/site-packages/skimage/__init__.py", line 167, in <module>
from .util.dtype import (img_as_float32,
File "/home/mattb/programs/anaconda3/envs/deleteme/lib/python3.7/site-packages/skimage/util/__init__.py", line 8, in <module>
from .arraycrop import crop
File "/home/mattb/programs/anaconda3/envs/deleteme/lib/python3.7/site-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' (/home/mattb/programs/anaconda3/envs/deleteme/lib/python3.7/site-packages/numpy/lib/arraypad.py)
skimage.__version__) 0.14.1This also occurs just by installing scikit-image alone:
Β mattbΒ ξ°Β ~Β ξ°Β conda create -n deleteme python=3 -y
Solving environment: done
## Package Plan ##
environment location: /home/mattb/programs/anaconda3/envs/deleteme
added / updated specs:
- python=3
The following NEW packages will be INSTALLED:
ca-certificates: 2018.03.07-0
certifi: 2018.11.29-py37_0
libedit: 3.1.20170329-h6b74fdf_2
libffi: 3.2.1-hd88cf55_4
libgcc-ng: 8.2.0-hdf63c60_1
libstdcxx-ng: 8.2.0-hdf63c60_1
ncurses: 6.1-he6710b0_1
openssl: 1.1.1a-h7b6447c_0
pip: 18.1-py37_0
python: 3.7.2-h0371630_0
readline: 7.0-h7b6447c_5
setuptools: 40.6.3-py37_0
sqlite: 3.26.0-h7b6447c_0
tk: 8.6.8-hbc83047_0
wheel: 0.32.3-py37_0
xz: 5.2.4-h14c3975_4
zlib: 1.2.11-h7b6447c_3
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use
#
# $ conda activate deleteme
#
# To deactivate an active environment, use
#
# $ conda deactivate
Β mattbΒ ξ°Β ~Β ξ°Β . activate deleteme
Β mattbΒ ξ°Β (e)Β deletemeΒ ξ°Β ~Β ξ°Β pip install scikit-image
Looking in indexes: https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-virtual/simple, https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-snapshot-local/simple
Collecting scikit-image
Downloading https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-virtual/packages/bc/b3/d294429adcc4aff0372208494f0f0625f1112428e56070e47bf2cd055579/scikit_image-0.14.1-cp37-cp37m-manylinux1_x86_64.whl (25.3MB)
100% |ββββββββββββββββββββββββββββββββ| 25.3MB 1.8MB/s
Collecting scipy>=0.17.0 (from scikit-image)
Downloading https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-virtual/packages/80/39/066ecde98f373430bf7a39a02d91c7075b01ef4fc928456e8e31577342d6/scipy-1.2.0-cp37-cp37m-manylinux1_x86_64.whl (26.6MB)
100% |ββββββββββββββββββββββββββββββββ| 26.6MB 1.8MB/s
Collecting six>=1.10.0 (from scikit-image)
Downloading https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-virtual/packages/73/fb/00a976f728d0d1fecfe898238ce23f502a721c0ac0ecfedb80e0d88c64e9/six-1.12.0-py2.py3-none-any.whl
Collecting networkx>=1.8 (from scikit-image)
Collecting PyWavelets>=0.4.0 (from scikit-image)
Downloading https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-virtual/packages/eb/38/210cf3c704be7f2706ea1397fbe2eeae4f88d791175918455daa65043b21/PyWavelets-1.0.1-cp37-cp37m-manylinux1_x86_64.whl (4.4MB)
100% |ββββββββββββββββββββββββββββββββ| 4.4MB 17.9MB/s
Collecting dask[array]>=0.9.0 (from scikit-image)
Downloading https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-virtual/packages/b4/e5/6407c2349622699eab0881e6bc6e978b8da67872a105e5e20b72ff190c65/dask-1.0.0-py2.py3-none-any.whl (685kB)
100% |ββββββββββββββββββββββββββββββββ| 686kB 46.3MB/s
Collecting matplotlib>=2.0.0 (from scikit-image)
Downloading https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-virtual/packages/e7/f9/5377596cb1c035c102396f5934237a046f80da69974026f90bee5db8b7ba/matplotlib-3.0.2-cp37-cp37m-manylinux1_x86_64.whl (12.9MB)
100% |ββββββββββββββββββββββββββββββββ| 12.9MB 8.1MB/s
Collecting pillow>=4.3.0 (from scikit-image)
Downloading https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-virtual/packages/ae/2a/0a0ab2833e5270664fb5fae590717f867ac6319b124160c09f1d3291de28/Pillow-5.4.1-cp37-cp37m-manylinux1_x86_64.whl (2.0MB)
100% |ββββββββββββββββββββββββββββββββ| 2.0MB 30.7MB/s
Collecting cloudpickle>=0.2.1 (from scikit-image)
Downloading https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-virtual/packages/fc/87/7b7ef3038b4783911e3fdecb5c566e3a817ce3e890e164fc174c088edb1e/cloudpickle-0.6.1-py2.py3-none-any.whl
Collecting numpy>=1.8.2 (from scipy>=0.17.0->scikit-image)
Downloading https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-virtual/packages/3d/10/62224c551acfd3a3583ad16d1e0f1c9e9c333e74479dc51977c31836119c/numpy-1.16.0-cp37-cp37m-manylinux1_x86_64.whl (17.3MB)
100% |ββββββββββββββββββββββββββββββββ| 17.3MB 4.1MB/s
Collecting decorator>=4.3.0 (from networkx>=1.8->scikit-image)
Downloading https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-virtual/packages/bc/bb/a24838832ba35baf52f32ab1a49b906b5f82fb7c76b2f6a7e35e140bac30/decorator-4.3.0-py2.py3-none-any.whl
Collecting toolz>=0.7.3; extra == "array" (from dask[array]>=0.9.0->scikit-image)
Collecting pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 (from matplotlib>=2.0.0->scikit-image)
Downloading https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-virtual/packages/de/0a/001be530836743d8be6c2d85069f46fecf84ac6c18c7f5fb8125ee11d854/pyparsing-2.3.1-py2.py3-none-any.whl (61kB)
100% |ββββββββββββββββββββββββββββββββ| 71kB 53.7MB/s
Collecting python-dateutil>=2.1 (from matplotlib>=2.0.0->scikit-image)
Downloading https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-virtual/packages/74/68/d87d9b36af36f44254a8d512cbfc48369103a3b9e474be9bdfe536abfc45/python_dateutil-2.7.5-py2.py3-none-any.whl (225kB)
100% |ββββββββββββββββββββββββββββββββ| 235kB 67.3MB/s
Collecting cycler>=0.10 (from matplotlib>=2.0.0->scikit-image)
Downloading https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-virtual/packages/f7/d2/e07d3ebb2bd7af696440ce7e754c59dd546ffe1bbe732c8ab68b9c834e61/cycler-0.10.0-py2.py3-none-any.whl
Collecting kiwisolver>=1.0.1 (from matplotlib>=2.0.0->scikit-image)
Downloading https://artifactory.corp.alleninstitute.org/artifactory/api/pypi/pypi-virtual/packages/5c/7e/d6cae2f241ba474a2665f24b480bf4e247036d63939dda2bbc4d2ee5069d/kiwisolver-1.0.1-cp37-cp37m-manylinux1_x86_64.whl (89kB)
100% |ββββββββββββββββββββββββββββββββ| 92kB 51.3MB/s
Requirement already satisfied: setuptools in ./programs/anaconda3/envs/deleteme/lib/python3.7/site-packages (from kiwisolver>=1.0.1->matplotlib>=2.0.0->scikit-image) (40.6.3)
Installing collected packages: numpy, scipy, six, decorator, networkx, PyWavelets, toolz, dask, pyparsing, python-dateutil, cycler, kiwisolver, matplotlib, pillow, cloudpickle, scikit-image
Successfully installed PyWavelets-1.0.1 cloudpickle-0.6.1 cycler-0.10.0 dask-1.0.0 decorator-4.3.0 kiwisolver-1.0.1 matplotlib-3.0.2 networkx-2.2 numpy-1.16.0 pillow-5.4.1 pyparsing-2.3.1 python-dateutil-2.7.5 scikit-image-0.14.1 scipy-1.2.0 six-1.12.0 toolz-0.9.0
Β mattbΒ ξ°Β (e)Β deletemeΒ ξ°Β ~Β ξ°Β python -c "import skimage"
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/mattb/programs/anaconda3/envs/deleteme/lib/python3.7/site-packages/skimage/__init__.py", line 167, in <module>
from .util.dtype import (img_as_float32,
File "/home/mattb/programs/anaconda3/envs/deleteme/lib/python3.7/site-packages/skimage/util/__init__.py", line 8, in <module>
from .arraycrop import crop
File "/home/mattb/programs/anaconda3/envs/deleteme/lib/python3.7/site-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' (/home/mattb/programs/anaconda3/envs/deleteme/lib/python3.7/site-packages/numpy/lib/arraypad.py)
It looks like the _validate_lengths function was removed in this commit: https://github.com/numpy/numpy/commit/a4b96ad7649281de2c3a41292fcbab4c77c0743d#diff-4fcddc9140fbe901655b3e1bd484205c
This has been fixed on master. I'll leave this issue open until a release of 0.14.2 has been made.
Ha, I just found #3551 as well. Thanks @stefanv!
Note to self: improve the release process to where a point release can happen at the push of a button, so that we can synchronize near-seamlessly with NumPy releases.
Perhaps there should be a note in https://scikit-image.org/ to state that skimage<=0.14.1 is incompatible with numpy>=1.16?
Also, is there a solid time line for 0.14.2 release?
This should be a pinned issue:
@pllim Timeline is as soon as possible, likely today still.
v0.14.2 has been released: https://github.com/scikit-image/scikit-image/blob/master/doc/release/release_0.14.rst
@stefanv : still failing with Python 2.7
Collecting numpy<1.17,>=1.14 (from -r requirements-travis.txt (line 1))
Downloading https://files.pythonhosted.org/packages/9f/85/163127d3fb0573deb9eca947cfc73aa3618eaaf8656501460574471d114a/numpy-1.16.0-cp27-cp27mu-manylinux1_x86_64.whl (17.0MB)
Collecting scikit-image<0.15,>=0.14 (from tensorlayer<1.12,>=1.9->-r requirements-travis.txt (line 3))
Downloading https://files.pythonhosted.org/packages/6a/04/f726af6b2e39a4dad0e5502670c4b33d5c915880a54a98aeb33b95150531/scikit_image-0.14.2-cp27-cp27mu-manylinux1_x86_64.whl (25.5MB)
Collecting dask[array]>=1.0.0 (from scikit-image<0.15,>=0.14->tensorlayer<1.12,>=1.9->-r requirements-travis.txt (line 3))
Downloading https://files.pythonhosted.org/packages/b4/e5/6407c2349622699eab0881e6bc6e978b8da67872a105e5e20b72ff190c65/dask-1.0.0-py2.py3-none-any.whl (685kB)
main.py:14: in <module>
from skimage.transform import resize
../../../virtualenv/python2.7.14/lib/python2.7/site-packages/skimage/__init__.py:167: in <module>
from .util.dtype import (img_as_float32,
../../../virtualenv/python2.7.14/lib/python2.7/site-packages/skimage/util/__init__.py:6: in <module>
from .apply_parallel import apply_parallel
../../../virtualenv/python2.7.14/lib/python2.7/site-packages/skimage/util/apply_parallel.py:8: in <module>
import dask.array as da
../../../virtualenv/python2.7.14/lib/python2.7/site-packages/dask/array/__init__.py:9: in <module>
from .routines import (take, choose, argwhere, where, coarsen, insert,
../../../virtualenv/python2.7.14/lib/python2.7/site-packages/dask/array/routines.py:256: in <module>
@wraps(np.matmul)
/opt/python/2.7.14/lib/python2.7/functools.py:33: in update_wrapper
setattr(wrapper, attr, getattr(wrapped, attr))
E AttributeError: 'numpy.ufunc' object has no attribute '__module__'
Seems like the error is on dask side, right ?
yeah, this is a dask bug. they should have a release to fix this today or later this week.
Hello all,
I came across the same issue. It took my few days but couldn't solve.
I restricted pip3 install numpy==1.15.4
but how do I restrict scikit-learn to upgrade the numpy?
can it use the numpy I have installed?
@komalpharate if you install numpy==1.15.4 and then scikit-learn/scikit-image, it should use that version and not upgrade to numpy==1.16.
I just tried with a fresh py27 env, and seems to work fine.
Hi - I'm getting this error to on the latest version.
If I downgrade to 1.15.4 I then get this error:
ValueError: numpy.ufunc size changed, may indicate binary incompatibility. Expected 216 from C header, got 192 from PyObject
Any other thoughts on how to go about solving for this?
how did you go about installing scikit-image?
@stefanv I'm getting the same error
from numpy.lib.arraypad import _validate_lengths
ImportError Traceback (most recent call last)
<ipython-input-6-30d1a12bd26c> in <module>
----> 1 from numpy.lib.arraypad import _validate_lengths
ImportError: cannot import name '_validate_lengths'
even after force-reinstalling scikit-image and numpy:
pip install scikit-image --force-reinstall
Successfully installed PyWavelets-1.0.2 cloudpickle-0.8.0 cycler-0.10.0 dask-1.1.3 decorator-4.3.2 kiwisolver-1.0.1 matplotlib-3.0.3 networkx-2.2 numpy-1.16.2 pillow-5.4.1 pyparsing-2.3.1 python-dateutil-2.8.0 scikit-image-0.14.2 scipy-1.2.1 setuptools-40.8.0 six-1.12.0 toolz-0.9.0
pip install numpy --force-reinstall
Successfully installed numpy-1.16.2
@aopisco Please file a new issue and fill out the provided template. Thanks.
Ran into the same problem yesterday. I don't see any open issue on this currently, I'll consider filing one.
python2.7, scikit-image 0.14.2, numpy 1.16.2
@edrozenberg hmm, given those versions, things should be working. I suspect you somehow have multiple scikit-image or NumPy versions installed.
Locking this issue to encourage users to file a new one. 0.14.2 should be compatible with numpy 1.16
Tried installing previous versions of numpy as well. Still can't resolve it
Update scikit-image? Sometimes multiple versions of numpy can be installed simultaneously... scikit-image 0.14.3 and 0.15.0 both resolve these problems.
If what @jni says doesn't work, can you open the anaconda prompt (open the start menu and type anaconda prompt) and type conda list and enter and give us that entire output
Run this version together to solve this problem
pip install scikit-image==0.14.2
pip install numpy==1.16
Run this version together to solve this problem
pip install scikit-image==0.14.2
pip install numpy==1.16
thank u so much!
Run this version together to solve this problem
pip install scikit-image==0.14.2
pip install numpy==1.16
I like unambiguous instructions that help me get on with my day. Cheers to you, sir
I am having similar issue on arm64 (Nvidia Jetson). Unfortunately cannot install with pip, instead use apt-get install python3-
numpy==1.18.3
scikit-image==0.14.0
ImportError: cannot import name '_validate_lengths
Any ideas for working around?
You will need scikit-image 0.14.1, which fixed the problem. Or you can patch your installation, or you can compile from scratch.
Note that 0.14 is pretty old by now!
@dkatsios @stefanv there is another option, installing numpy==1.15
@jni would you know how this can be done for arm64 architecture? running pip3 install numpy==1.15 wouldn't work. Instead I have to run apt-get install python3-numpy. the only available version I get for this is 1.13.1 which corresponds to numpy 1.18.3.
Oh I didn't realise that apt wouldn't let you install older versions. Um... If there is really no later version of skimage available for ARM, you might be down to @stefanv's solution, patching your install. If your distro ships the uncompiled Python code, you can do:
python3 -c "import skimage; print(skimage)"
to find out where the skimage code tree is. It'll be something like [....]/skimage/__init__.py.
Then, open the file (you'll need root) [....]/skimage/util/arraycrop.py, remove the line from numpy.lib.arraypad import _validate_lengths, and then uncomment all of the commented code.
Hope this helps!!!
Most helpful comment
Run this version together to solve this problem
pip install scikit-image==0.14.2
pip install numpy==1.16