geopandas / contextily

Context geo-tiles in Python
https://contextily.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
530 stars 83 forks source link

Error on importing contextily #186

Closed kirui93 closed 3 years ago

kirui93 commented 3 years ago

I have a project ongoing and I am importing contextily but I am getting the following error:

import contextily

ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject

ValueError Traceback (most recent call last)

in ----> 1 import contextily as ctx ~\AppData\Local\Programs\Python\Python39\lib\site-packages\contextily\__init__.py in 5 from . import tile_providers as sources 6 from ._providers import providers ----> 7 from .place import Place, plot_map 8 from .tile import * 9 from .plotting import add_basemap, add_attribution ~\AppData\Local\Programs\Python\Python39\lib\site-packages\contextily\place.py in 5 import warnings 6 ----> 7 from .tile import howmany, bounds2raster, bounds2img, _sm2ll, _calculate_zoom 8 from .plotting import INTERPOLATION, ZOOM, add_attribution 9 from . import providers ~\AppData\Local\Programs\Python\Python39\lib\site-packages\contextily\tile.py in 14 15 import numpy as np ---> 16 import rasterio as rio 17 from PIL import Image 18 from joblib import Memory as _Memory ~\AppData\Local\Programs\Python\Python39\lib\site-packages\rasterio\__init__.py in 15 from pathlib import Path 16 ---> 17 from rasterio._base import gdal_version 18 from rasterio.drivers import driver_from_extension, is_blacklisted 19 from rasterio.dtypes import ( rasterio\_base.pyx in init rasterio._base() rasterio\_shim.pyx in init rasterio._shim() ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject

I have uninstalled Numpy and installed the latest version but I still got the same error.

Is there any solution for this?

kirui93 commented 3 years ago

Solved!

Uninstall numpy and install the latest version pip3 uninstall numpy pip3 install numpy

unistall numpy install numpy