question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pip install numpy 1.15 from wheel: numpy.dtype size changed Expected 96, got 88

See original GitHub issue

After pip install numpy 1.15 from a wheel,

print "np.dtype.__basicsize__:", np.dtype.__basicsize__  # 96
print "scipy.dtype.__basicsize__:", scipy.dtype.__basicsize__  # 96
from scipy import stats
~ 20 RuntimeWarning: numpy.dtype size   changed, may indicate binary incompatibility. Expected 96, got 88

(Please add labels, don’t see them; is there a label “strange” ?)

A shell script to reproduce this:

#!/bin/bash
# re-install numpy scipy: https://github.com/numpy/numpy/issues/11537  denis 27july

( cd $site;  rm -r tmp;  mkdir tmp;  mv numpy* scipy* tmp )
rm -r ~/Library/Caches/pip

#...............................................................................
pip2 install --user numpy scipy

python2 -c '
import sys
import numpy as np
import scipy

print "versions: numpy %s  scipy %s  python %s  " % (
		np.__version__, scipy.__version__ , sys.version )
print "np.dtype.__basicsize__:", np.dtype.__basicsize__
print "scipy.dtype.__basicsize__:", scipy.dtype.__basicsize__

from scipy import stats
'

pip2 --version
ls -l $site/scipy/*/*cython*.so
otool -L $site/scipy/*/*cython*.so  # mac

and the logfile:

Collecting numpy
  Downloading https://files.pythonhosted.org/packages/3c/bf/e36756c562f7386be78c6942f0a8a647ee4eb374cdf219bece7054832b14/numpy-1.15.0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (24.5MB)
Collecting scipy
  Downloading https://files.pythonhosted.org/packages/d1/d6/3eac96ffcf7cbeb37ed72982cf3fdd3138472cb04ab32cdce1f444d765f2/scipy-1.1.0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (16.8MB)
Installing collected packages: numpy, scipy
  The scripts conv-template, f2py and from-template are installed in '/Users/bz/Library/Python/2.7/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed numpy-1.15.0 scipy-1.1.0
versions: numpy 1.15.0  scipy 1.1.0  python 2.7.15 (v2.7.15:ca079a3ea3, Apr 29 2018, 20:59:26) 
[GCC 4.2.1 Compatible Apple LLVM 6.0 (clang-600.0.57)]  
np.dtype.__basicsize__: 96
scipy.dtype.__basicsize__: 96
/Library/Python/2.7/site-packages/scipy/special/__init__.py:640: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
  from ._ufuncs import *
/Library/Python/2.7/site-packages/scipy/linalg/basic.py:17: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
  from ._solve_toeplitz import levinson
/Library/Python/2.7/site-packages/scipy/linalg/__init__.py:207: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
  from ._decomp_update import *
/Library/Python/2.7/site-packages/scipy/special/_ellip_harm.py:7: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
  from ._ellip_harm_2 import _ellipsoid, _ellipsoid_norm
/Library/Python/2.7/site-packages/scipy/interpolate/_bsplines.py:10: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
  from . import _bspl
/Library/Python/2.7/site-packages/scipy/sparse/lil.py:19: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
  from . import _csparsetools
/Library/Python/2.7/site-packages/scipy/sparse/csgraph/__init__.py:165: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
  from ._shortest_path import shortest_path, floyd_warshall, dijkstra,\
/Library/Python/2.7/site-packages/scipy/sparse/csgraph/_validation.py:5: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
  from ._tools import csgraph_to_dense, csgraph_from_dense,\
/Library/Python/2.7/site-packages/scipy/sparse/csgraph/__init__.py:167: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
  from ._traversal import breadth_first_order, depth_first_order, \
/Library/Python/2.7/site-packages/scipy/sparse/csgraph/__init__.py:169: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
  from ._min_spanning_tree import minimum_spanning_tree
/Library/Python/2.7/site-packages/scipy/sparse/csgraph/__init__.py:170: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
  from ._reordering import reverse_cuthill_mckee, maximum_bipartite_matching, \
/Library/Python/2.7/site-packages/scipy/spatial/__init__.py:95: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
  from .ckdtree import *
/Library/Python/2.7/site-packages/scipy/spatial/__init__.py:96: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
  from .qhull import *
/Library/Python/2.7/site-packages/scipy/spatial/_spherical_voronoi.py:18: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
  from . import _voronoi
/Library/Python/2.7/site-packages/scipy/spatial/distance.py:122: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
  from . import _hausdorff
/Library/Python/2.7/site-packages/scipy/optimize/_trlib/__init__.py:1: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
  from ._trlib import TRLIBQuadraticSubproblem
/Library/Python/2.7/site-packages/scipy/optimize/_numdiff.py:10: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
  from ._group_columns import group_dense, group_sparse
/Library/Python/2.7/site-packages/scipy/stats/_continuous_distns.py:18: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
  from . import _stats
pip 18.0 from /Library/Python/2.7/site-packages/pip (python 2.7)
-rwxr-xr-x 1 bz admin  306652 Jul 27 11:34 /Library/Python/2.7/site-packages/scipy/linalg/cython_blas.so
-rwxr-xr-x 1 bz admin  817100 Jul 27 11:34 /Library/Python/2.7/site-packages/scipy/linalg/cython_lapack.so
-rwxr-xr-x 1 bz admin 2738116 Jul 27 11:34 /Library/Python/2.7/site-packages/scipy/special/cython_special.so
/Library/Python/2.7/site-packages/scipy/linalg/cython_blas.so:
	@loader_path/../.dylibs/libgfortran.3.dylib (compatibility version 4.0.0, current version 4.0.0)
	/System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate (compatibility version 1.0.0, current version 4.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.60.2)
	@loader_path/../.dylibs/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
	@loader_path/../.dylibs/libquadmath.0.dylib (compatibility version 1.0.0, current version 1.0.0)
/Library/Python/2.7/site-packages/scipy/linalg/cython_lapack.so:
	@loader_path/../.dylibs/libgfortran.3.dylib (compatibility version 4.0.0, current version 4.0.0)
	/System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate (compatibility version 1.0.0, current version 4.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.60.2)
	@loader_path/../.dylibs/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
	@loader_path/../.dylibs/libquadmath.0.dylib (compatibility version 1.0.0, current version 1.0.0)
/Library/Python/2.7/site-packages/scipy/special/cython_special.so:
	@loader_path/../.dylibs/libgfortran.3.dylib (compatibility version 4.0.0, current version 4.0.0)
	/System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate (compatibility version 1.0.0, current version 4.0.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1238.60.2)
	@loader_path/../.dylibs/libgcc_s.1.dylib (compatibility version 1.0.0, current version 1.0.0)
	@loader_path/../.dylibs/libquadmath.0.dylib (compatibility version 1.0.0, current version 1.0.0)

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:18 (8 by maintainers)

github_iconTop GitHub Comments

6reactions
alexiswlcommented, Aug 20, 2018

For now, rolling back to numpy 1.14.5 through conda, will resolve this conda install numpy==1.14.5 --yes

2reactions
denis-bzcommented, Jul 29, 2018

Sure, filter. But where’s the size 88 in numpy 1.15 coming from – what changed, if not numpy.dtype: the wheel build chain, .dylibs ?

#!/bin/bash
# https://github.com/numpy/numpy/issues/11628
# scipy 1.1.0, numpy 1.14.5: no warning
# scipy 1.1.0, numpy 1.15.0: RuntimeWarning: numpy.dtype size changed Expected 96, got 88

set -v

PYTHONPATH=/Library/Python/2.7/site-packages \
PYTHONSTARTUP="" \
\
python2 -c '
import numpy
print "numpy", numpy.__version__, numpy.__path__

import scipy
print "scipy", scipy.__version__, scipy.__path__

from scipy.linalg import solve_toeplitz  # 2 RuntimeWarnings
'
Read more comments on GitHub >

github_iconTop Results From Across the Web

RuntimeWarning: numpy.dtype size changed, may indicate ...
This error occurs because the installed packages were build agains different version of numpy. We need to rebuild scipy and ...
Read more >
NumPy 1.20.0 Release Notes
Preliminary work in changing the dtype and casting implementations in order to provide an easier path to extending dtypes. This work is ongoing...
Read more >
Python warning numpy.dtype size changed, may indicate ...
RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88 from .tslib import iNaT, NaT, Timestamp, Timedelta, ...
Read more >
install problem with qiime 1.9 and newest Anaconda ...
ValueError: numpy.dtype has the wrong size, try recompiling ... conda create -n qiime1 python=2.7 qiime matplotlib=1.4.3 mock nose -c ...
Read more >
Python numpy库版本不符合要求 - CSDN博客
... numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88 from pandas._libs import (hashtable as _hashtable, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found