`import rasterio` error on Win7 and Mac: ValueError: numpy.dtype has the wrong size, try recompiling
nurbachris@...
I am having the same problem on Windows 7 and Mac OS X High Sierra: 1) Windows 7 (64 bits) Using python 2.7 (32 bits). I have installed GDAL Core and its Python bindings using the executables here (resp. gdal-202-1500-core.msi and GDAL-2.2.3.win32-py2.7.msi). This worked well and I could successfully use gdal in python scripts. Then I tried to install rasterio using rasterio‑1.0.3‑cp27‑cp27m‑win32.whl: This went through successfully. However when starting python and invoking
2) Mac OS X High Sierra (10.13.6) Interestingly, I am having exactly the same error on Mac OS X High Sierra after installing GDAL Complete 2.1 from here, and rasterio using: The installation steps are successful, but I get the same error as above when executing
I have read posts advising to upgrade numpy, however it is installed as distutils project (on both systems) and therefore I cannot upgrade with pip. So I am not sure what is the best way forward. Any help would be greatly appreciated.
|
|
Sean Gillies
I am sorry, but upgrading numpy is the only way forward. If you don't want to overwrite your existing numpy installation, you have several options. I believe the following two are the best. Other group members may have different experiences. 1. Download python 3.6 or 3.7 from python.org and install it. Now you have a brand new (and better) version of python into which you can install packages. On your Mac, `python3 -m pip install rasterio` will cause numpy to be fetched and installed, too. On your Windows computer, you will need to get numpy separately from https://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy and install it. 2. Install Miniconda (3.6 again) https://conda.io/miniconda.html and get Rasterio from conda-forge: `conda install -c conda-forge rasterio`. Good luck!
On Tue, Aug 7, 2018 at 8:33 AM <nurbachris@...> wrote:
-- Sean Gillies
|
|