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

numpy.core.multiarray failed to import #72

Closed
HTLife opened this issue Mar 28, 2018 · 3 comments
Closed

numpy.core.multiarray failed to import #72

HTLife opened this issue Mar 28, 2018 · 3 comments

Comments

@HTLife
Copy link

HTLife commented Mar 28, 2018

import numpy as np
import quaternion
np.quaternion(1,0,0,0)
RuntimeErrorTraceback (most recent call last)
RuntimeError: module compiled against API version 0xc but this version of numpy is 0xb


ImportErrorTraceback (most recent call last)
<ipython-input-6-9f69562c49db> in <module>()
      1 import numpy as np
----> 2 import quaternion
      3 np.quaternion(1,0,0,0)

/usr/local/lib/python2.7/dist-packages/quaternion/__init__.py in <module>()
      6 import numpy as np
      7 
----> 8 from .numpy_quaternion import (quaternion, _eps,
      9                                from_spherical_coords, from_euler_angles,
     10                                rotor_intrinsic_distance, rotor_chordal_distance,

ImportError: numpy.core.multiarray failed to import
@HTLife
Copy link
Author

HTLife commented Mar 28, 2018

After reinstall numpy and numpy-quaternion, this issue could be resolve.

pip uninstall numpy
pip uninstall numpy-quaternion
pip install numpy numpy-quaternion

@HTLife HTLife closed this as completed Mar 28, 2018
@moble
Copy link
Owner

moble commented Mar 28, 2018

For anyone else who finds this issue, the failed multiarray import is common across many modules that use numpy (not just this one), and is generally due to mismatched versions of libraries used to compile things — usually specifically numpy, not the module that depends on it. So the usual solution to this problem is simply

pip install --upgrade --force-reinstall numpy

Some people on Windows have apparently also reported needing to restart their computers.

@bram-ivs
Copy link

bram-ivs commented May 4, 2018

If you don't want to (or unable) upgrade numpy, you can also compile numpy-quaternion from source to avoid the binary mismatch.

pip install --no-binary ":all:" numpy-quaternion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants