[英]I cannot import gdal in Python 3.9.4, even if I've installed it successfully
I have an issue in importing gdal in Python 3.9.4.我在 Python 3.9.4 中导入 gdal 时遇到问题。
I installed "gdal-302-1928-x64-core.msi" and "GDAL-3.2.1.win-amd64-py3.6.msi" taken from https://gisinternals.com/query.html?content=filelist&file=release-1928-x64-gdal-3-2-1-mapserver-7-6-2.zip我安装了取自https://gisinternals.com/query.html? =release-1928-x64-gdal-3-2-1-mapserver-7-6-2.zip
I also installed "GDAL-3.2.2-cp39-cp39-win_amd64.whl" taken from https://www.lfd.uci.edu/~gohlke/pythonlibs/我还安装了取自https://www.lfd.uci.edu/~gohlke/pythonlibs/的“GDAL-3.2.2-cp39-cp39-win_amd64.whl”
When I tried to import it, it looks like this: click this当我尝试导入它时,它看起来像这样:单击此
It says:它说:
Traceback (most recent call last): File stdin, line 1, in module. ModuleNotFoundError: No module named 'gdal'
For setting environmental & system variables, I've managed it well, but still not helping me.对于设置环境和系统变量,我管理得很好,但仍然没有帮助我。 Probably I should install "GDAL-3.2.2.win-amd64-py3.9.msi" but I don't find it in https://gisinternals.com/
可能我应该安装“GDAL-3.2.2.win-amd64-py3.9.msi”,但我在https://gisinternals.com/中找不到它
Could someone help me?有人可以帮助我吗? Thank you.
谢谢你。
Regards, Arfah问候, 阿尔法
Always download packages suitable to the Python version you are using.始终下载适合您正在使用的 Python 版本的软件包。 Yes correctly:"GDAL-3.2.2.win-amd64-py3.9.msi" should be installed,and by doing so automatically the osgeo along with teh egg-info package will be installed in $PYTHONPATH/Lib/site-packages/.
是的,正确:应该安装“GDAL-3.2.2.win-amd64-py3.9.msi”,并通过自动安装 osgeo 以及 egg-info package 将安装在 $PYTHONPATH/Lib/site-packages /。
To correct the error, you should use:要更正错误,您应该使用:
from osgeo import gdal
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.