Importerror:numpy.core.multiarray未能导入GDAL
这个问题已经在stackoverflow上( inforterror:numpy.core.core.core.multiarriray未能导入<<< /a>),但没有答案。
我确实安装了GDAL:GDAL-3.4.2-CP37-CP37M-WIN_AMD64.WHL和NUMPY:NUMPY-1.21.6+MKL-CP37-CP37-CP37-CP37M-WIN_AMD64.WHL来自网站: https://www.lfd.uci.edu/~gohlke/~gohlke/pythonlibs/pythonlibs/pythonlibs/pythonlibs/#_gdal
代码> .readasarray(0,0,500,500)我遇到此错误:
RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd
Traceback (most recent call last):
File "D:\adress\Codes\EdgeN2m.py", line 26, in <module>
e = EDGE.ReadAsArray(0,0,500,500)
File "C:\Users\name\miniconda3\lib\site-packages\osgeo\gdal.py", line 3655, in ReadAsArray
from osgeo import gdal_array
File "C:\Users\name\miniconda3\lib\site-packages\osgeo\gdal_array.py", line 13, in <module>
from . import _gdal_array
ImportError: numpy.core.multiarray failed to import
This question is already on StackOverflow (ImportError: numpy.core.multiarray failed to import) but no Answer helped.
I did install GDAL: GDAL-3.4.2-cp37-cp37m-win_amd64.whl and numpy: numpy-1.21.6+mkl-cp37-cp37m-win_amd64.whl from the website : https://www.lfd.uci.edu/~gohlke/pythonlibs/#_gdal
By using the command .ReadAsArray(0,0,500,500)
I am getting this error:
RuntimeError: module compiled against API version 0xe but this version of numpy is 0xd
Traceback (most recent call last):
File "D:\adress\Codes\EdgeN2m.py", line 26, in <module>
e = EDGE.ReadAsArray(0,0,500,500)
File "C:\Users\name\miniconda3\lib\site-packages\osgeo\gdal.py", line 3655, in ReadAsArray
from osgeo import gdal_array
File "C:\Users\name\miniconda3\lib\site-packages\osgeo\gdal_array.py", line 13, in <module>
from . import _gdal_array
ImportError: numpy.core.multiarray failed to import
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以安装具有不同版本的Numpy来检查哪个可以工作。
对我来说,我安装了与Numpy-1.22.0兼容的GDAL-3.4.3,
希望这会有所帮助。
You can install the numpy with different version to check which one can work.
For me, I install gdal-3.4.3 which is compatible with numpy-1.22.0
Hope this helps.