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 #444

Closed
guicostas opened this issue Dec 17, 2018 · 2 comments
Closed

numpy.core.multiarray failed to import #444

guicostas opened this issue Dec 17, 2018 · 2 comments

Comments

@guicostas
Copy link

RuntimeError: module compiled against API version 0xc but this version of numpy is 0xb
Traceback (most recent call last):
File "brazil.py", line 3, in
from mpl_toolkits.basemap import Basemap
File "/usr/local/lib/python2.7/dist-packages/mpl_toolkits/basemap/init.py", line 37, in
import _geoslib
ImportError: numpy.core.multiarray failed to import

@molinav
Copy link
Member

molinav commented Jan 22, 2022

Could you provide some more information about your working environment? This would mean:

  • Operating system.
  • Python version (I guess 2.7).
  • Channel used to install things (e.g. PyPI, Anaconda, GNU/Linux repositories).

If you are using either Windows or GNU/Linux, I would recommend you to install basemap using pip. Since version 1.3.0 we provide precompiled binary wheels and it is as simple as doing:

python -m pip install basemap

In case you need the high-resolution auxiliary datasets, you would have to install them manually:

python -m pip install basemap-data-hires

@molinav
Copy link
Member

molinav commented Aug 10, 2022

I am closing this issue due to lack of feedback. From your traceback

RuntimeError: module compiled against API version 0xc but this version of numpy is 0xb

this is the typical problem that occurs when you build basemap using a newer numpy version (e.g. >= 1.20) but later run it with an elder numpy version (e.g. < 1.20). There has been effort in remediating this issue by creating GitHub Actions that generate precompiled binary wheels for different platforms (in your case it looks like GNU/Linux).

I would just recommend you install the precompiled wheels from PyPI if you cannot (or do not want to) build from source. In addition, the basemap repository now contains a pyproject.toml file with the proper definition of the build dependencies, so this problem should not be appearing anymore.

@molinav molinav closed this as completed Aug 10, 2022
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

2 participants