Scikit-image: numpy.ufunc size changed, may indicate binary incompatibility. Expected 216 from C header, got 192 from PyObject.

Created on 17 Jan 2019  Â·  24Comments  Â·  Source: scikit-image/scikit-image

Help! I am installing from source because I need a bug fix for houghlines that is not in the latest release.

I get the message "Expected 216 from C header, got 192 from PyObject."

Possibly it is a numpy incompatibility. However I was also getting the reverse message "Expected 192 but got 216" for bcolz until I moved it to later in the install.

How can I install bcolz, numpy, pytorch, skimage at the same time?

Most helpful comment

As of now, I tried rolling back numpy to 1.14.5 and all other versions but none worked but upgrading to 1.16.1 finally fixed it!.

pip install numpy==1.16.1

All 24 comments

The new NumPy release is tripping a lot of people up. Please downgrade your NumPy to a previous version, or use conda-forge for now. We are planning a new release for later today. See also https://github.com/scikit-image/scikit-image/issues/3649

New release of skimage fixed it thanks. Not sure of cause but was not using latest release of numpy.

Interesting. Maybe you can tell us more about how you installed numpy, scikit-image, and pytorch if it happens again.

Things like OS, python version, pip vs conda are important.

FYI

ubuntu18.04, python 3.7 via miniconda latest
pip install numpy
conda install pytorch-cpu -c pytorch
compile skimage according to instructions

Pytorch is not available on pip. If I took out the pytorch install then
skimage worked. The version of pytorch is same as previously worked but it
installs dependencies which have changed including numpy (though not the
latest version).

On Fri, 18 Jan 2019 at 14:01, Mark Harfouche notifications@github.com
wrote:

Interesting. Maybe you can tell us more about how you installed numpy,
scikit-image, and pytorch if it happens again.

Things like OS, python version, pip vs conda are important.

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/scikit-image/scikit-image/issues/3655#issuecomment-455555631,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABJN6U2I9AQEBKi4VEwjFxTcV3thV7mHks5vEdPDgaJpZM4aGuDE
.

is there a particular reason why you are compiling skimage from source?
do the packages on conda not work?
are you using conda-forge???

the issue is likely (though not 100% sure) that you are likely compiling skimage with a newer version of numpy than pytorch was compiled with

oh yeah, also, don't install one package with pip, the other with conda. that is a recipe for disaster.

mostly, you really shouldn't install numpy via pip. if a package exists on conda, you should use that. if it doesn't you can probably request it to be on conda-forge
https://github.com/conda-forge/staged-recipes

Required the source as there was a bug in houghlines which was fixed in
source but not in the release at the time - it is now!. I was trying to
install everything with pip so it would all be in one install and more
things are on pip than conda. The only ones not on pip were Pytorch and
skimage which was from source.

On Fri, 18 Jan 2019 at 14:09, Mark Harfouche notifications@github.com
wrote:

is there a particular reason why you are compiling skimage from source?
do the packages on conda not work?
are you using conda-forge???

the issue is likely (though not 100% sure) that you are likely compiling
skimage with a newer version of numpy than pytorch was compiled with

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/scikit-image/scikit-image/issues/3655#issuecomment-455557866,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABJN6YxwqK3Kn510E4UMWa3k7PEmG-Muks5vEdWdgaJpZM4aGuDE
.

oh man, it was a bug in the pyx file, so you couldn't have just fixed it yourself. Yeah.....

there was some discussion about having more frequent releases. unfortunately, it doesn't seem to have gone anywhere, likely due to lack of bandwidth.

I think it is reasonable to try and find that issue, or to open a new one asking for more releases. Explaining your story (wanting to install pytorch and scikit-image) is likely good enough.

pytorch now exists on pip no?

https://pytorch.org/

mostly, you really shouldn't install numpy via pip. if a package exists on conda, you should use that. if it doesn't you can probably request it to be on conda-forge
https://github.com/conda-forge/staged-recipes

Many of us use pip exclusively, actually; so, use whatever the default installer of your environment is. Try to stick to "all conda" or "all pip".

Many of us use pip exclusively, actually; so, use whatever the default installer of your environment is. Try to stick to "all conda" or "all pip".

Consistency is more what I was looking for. Thanks for making that clear @stefanv

I just tried doing it all in conda. First difference is that it takes
longer or seems to because nothing happens for ages. Second thing is it
downgrades python from 3.7 to 2.7 and as I am doing this in one line for a
docker build it is unclear which of the 30+ packages is doing that. And the
latest skimage release isn't available on conda-forge yet!

On Fri, 18 Jan 2019 at 18:45, Mark Harfouche notifications@github.com
wrote:

Many of us use pip exclusively, actually; so, use whatever the default
installer of your environment is. Try to stick to "all conda" or "all pip".

Consistency is more what I was looking for. Thanks for making that clear
@stefanv https://github.com/stefanv

—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
https://github.com/scikit-image/scikit-image/issues/3655#issuecomment-455647740,
or mute the thread
https://github.com/notifications/unsubscribe-auth/ABJN6blp9Qs9oPlhU148kZiJz3GClDlyks5vEhZXgaJpZM4aGuDE
.

it might be because you have something like a dependency that only exists on python2.7. for example, enum34 is one of these.

conda knows that it is being slow these days. they are trying to fix it.....

As of now, I tried rolling back numpy to 1.14.5 and all other versions but none worked but upgrading to 1.16.1 finally fixed it!.

pip install numpy==1.16.1

this works.

As of now, I tried rolling back numpy to 1.14.5 and all other versions but none worked but upgrading to 1.16.1 finally fixed it!.

pip install numpy==1.16.1

thank You! it helped

HI Everyone .. i m getting below error need your help
from .murmurhash import murmurhash3_32

File "__init__.pxd", line 918, in init sklearn.utils.murmurhash

ValueError: numpy.ufunc size changed, may indicate binary incompatibility. Expected 216 from C header, got 192 from PyObject

i m using version:
Package Version


absl-py 0.8.1
alabaster 0.7.12
asn1crypto 0.24.0
astor 0.8.0
astroid 1.6.5
Babel 2.7.0
backcall 0.1.0
bleach 1.5.0
certifi 2018.8.24
cffi 1.11.5
chardet 3.0.4
cloudpickle 1.2.2
colorama 0.4.1
cryptography 2.3.1
cycler 0.10.0
decorator 4.4.1
defusedxml 0.6.0
docutils 0.14
entrypoints 0.2.3
gast 0.3.2
grpcio 1.25.0
h5py 2.8.0
html5lib 0.9999999
idna 2.7
imagesize 1.1.0
ipykernel 4.10.0
ipython 6.5.0
ipython-genutils 0.2.0
isort 4.3.4
jedi 0.12.1
Jinja2 2.10.3
joblib 0.14.0
jsonschema 2.6.0
jupyter-client 5.3.3
jupyter-core 4.5.0
Keras 2.2.2
Keras-Applications 1.0.8
Keras-Preprocessing 1.1.0
keyring 13.2.1
kiwisolver 1.0.1
lazy-object-proxy 1.3.1
List 1.3.0
Markdown 3.1.1
MarkupSafe 1.0
matplotlib 3.0.0
mccabe 0.6.1
mistune 0.8.3
nbconvert 5.5.0
nbformat 4.4.0
numpy 1.17.4
numpydoc 0.9.1
packaging 19.2
pandas 0.23.4
pandocfilters 1.4.2
parso 0.5.1
pickleshare 0.7.4
pip 10.0.1
prompt-toolkit 1.0.15
protobuf 3.11.1
psutil 5.4.7
pycodestyle 2.4.0
pycparser 2.19
pyflakes 2.0.0
Pygments 2.5.2
pylint 1.9.2
pyOpenSSL 18.0.0
pyparsing 2.4.5
PySocks 1.6.8
python-dateutil 2.8.1
pytz 2019.3
pywin32 223
PyYAML 3.13
pyzmq 17.1.2
QtAwesome 0.6.0
qtconsole 4.6.0
QtPy 1.9.0
requests 2.19.1
rope 0.14.0
scikit-learn 0.18
scipy 1.1.0
setuptools 39.1.0
simplegeneric 0.8.1
six 1.13.0
sklearn 0.0
snowballstemmer 2.0.0
Sphinx 2.2.2
sphinxcontrib-applehelp 1.0.1
sphinxcontrib-devhelp 1.0.1
sphinxcontrib-htmlhelp 1.0.2
sphinxcontrib-jsmath 1.0.1
sphinxcontrib-qthelp 1.0.2
sphinxcontrib-serializinghtml 1.1.3
spyder 3.3.1
spyder-kernels 0.2.6
tensorboard 1.11.0
tensorflow 1.11.0
termcolor 1.1.0
testpath 0.4.4
tornado 5.1.1
traitlets 4.3.2
urllib3 1.23
wcwidth 0.1.7
webencodings 0.5.1
Werkzeug 0.16.0
wheel 0.33.6
win-inet-pton 1.0.1
win-unicode-console 0.5
wincertstore 0.2
wrapt 1.10.11

while using

from sklearn.model_selection import train_test_split

HI Everyone .. i m getting below error need your help
from .murmurhash import murmurhash3_32

File "init.pxd", line 918, in init sklearn.utils.murmurhash

ValueError: numpy.ufunc size changed, may indicate binary incompatibility. Expected 216 from C header, got 192 from PyObject

i m using version:
Package Version

absl-py 0.8.1
alabaster 0.7.12
asn1crypto 0.24.0
astor 0.8.0
astroid 1.6.5
Babel 2.7.0
backcall 0.1.0
bleach 1.5.0
certifi 2018.8.24
cffi 1.11.5
chardet 3.0.4
cloudpickle 1.2.2
colorama 0.4.1
cryptography 2.3.1
cycler 0.10.0
decorator 4.4.1
defusedxml 0.6.0
docutils 0.14
entrypoints 0.2.3
gast 0.3.2
grpcio 1.25.0
h5py 2.8.0
html5lib 0.9999999
idna 2.7
imagesize 1.1.0
ipykernel 4.10.0
ipython 6.5.0
ipython-genutils 0.2.0
isort 4.3.4
jedi 0.12.1
Jinja2 2.10.3
joblib 0.14.0
jsonschema 2.6.0
jupyter-client 5.3.3
jupyter-core 4.5.0
Keras 2.2.2
Keras-Applications 1.0.8
Keras-Preprocessing 1.1.0
keyring 13.2.1
kiwisolver 1.0.1
lazy-object-proxy 1.3.1
List 1.3.0
Markdown 3.1.1
MarkupSafe 1.0
matplotlib 3.0.0
mccabe 0.6.1
mistune 0.8.3
nbconvert 5.5.0
nbformat 4.4.0
numpy 1.17.4
numpydoc 0.9.1
packaging 19.2
pandas 0.23.4
pandocfilters 1.4.2
parso 0.5.1
pickleshare 0.7.4
pip 10.0.1
prompt-toolkit 1.0.15
protobuf 3.11.1
psutil 5.4.7
pycodestyle 2.4.0
pycparser 2.19
pyflakes 2.0.0
Pygments 2.5.2
pylint 1.9.2
pyOpenSSL 18.0.0
pyparsing 2.4.5
PySocks 1.6.8
python-dateutil 2.8.1
pytz 2019.3
pywin32 223
PyYAML 3.13
pyzmq 17.1.2
QtAwesome 0.6.0
qtconsole 4.6.0
QtPy 1.9.0
requests 2.19.1
rope 0.14.0
scikit-learn 0.18
scipy 1.1.0
setuptools 39.1.0
simplegeneric 0.8.1
six 1.13.0
sklearn 0.0
snowballstemmer 2.0.0
Sphinx 2.2.2
sphinxcontrib-applehelp 1.0.1
sphinxcontrib-devhelp 1.0.1
sphinxcontrib-htmlhelp 1.0.2
sphinxcontrib-jsmath 1.0.1
sphinxcontrib-qthelp 1.0.2
sphinxcontrib-serializinghtml 1.1.3
spyder 3.3.1
spyder-kernels 0.2.6
tensorboard 1.11.0
tensorflow 1.11.0
termcolor 1.1.0
testpath 0.4.4
tornado 5.1.1
traitlets 4.3.2
urllib3 1.23
wcwidth 0.1.7
webencodings 0.5.1
Werkzeug 0.16.0
wheel 0.33.6
win-inet-pton 1.0.1
win-unicode-console 0.5
wincertstore 0.2
wrapt 1.10.11

while using

from sklearn.model_selection import train_test_split

Any success in making this work?

@mdtahsinasif @juniorojha This is the scikit-image issue tracker, not scikit-learn. Having said that, I expect that you need to either upgrade your scikit-image/learn or downgrade your NumPy.

oh yeah, also, don't install one package with pip, the other with conda. that is a recipe for disaster.

If that is the case then what should we do when one any package is not available in conda but exists in pip?

As of now, I tried rolling back numpy to 1.14.5 and all other versions but none worked but upgrading to 1.16.1 finally fixed it!.
pip install numpy==1.16.1

This worked

@manish-tiwari

If that is the case then what should we do when one any package is not available in conda but exists in pip?

As a last resort, you install it with pip. @hmaarrfk did not mean that as a hard rule but as a guideline. Ultimately, mixing pip and conda can lead to incompatible compiled binary code (code like NumPy that is not written in Python but rather C with Python "bindings", meaning ways to access the C code), at which point you usually have to start with a fresh environment.

Thanks for better explaining my thoughts jni.

We really want to do our best to help people still experiencing a similar issue.

Opening a new on GitHub is the best way to do that. Feel free to open them!

As of now, I tried rolling back numpy to 1.14.5 and all other versions but none worked but upgrading to 1.16.1 finally fixed it!.

pip install numpy==1.16.1

its work

Was this page helpful?
0 / 5 - 0 ratings