简体   繁体   English

即使安装成功,我也无法在 Python 3.9.4 中导入 gdal

[英]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.

相关问题 如何在 Windows 10 和 python 3.7 中使用 conda 安装 gdal? 安装geoviews后,我再也没有设法使用gdal - How to install gdal using conda in Windows 10 with python 3.7? After I installed geoviews I´ve never managed to use gdal again 即使安装成功,也无法导入 sklearn - cannot import sklearn even though it is installed successfully 为什么我在 Python 中安装了 selenium 之后它仍然无法工作? - Why is selenium not working even after I've installed it in Python? 无法在虚拟环境中导入'flask_wtf'和'wtforms',即使我已经安装了它们? - Unable to import 'flask_wtf' & 'wtforms' in a virtual env even though I've already pip installed them? 我无法导入pylab-即使已经安装了matplotlib,numpy和scipy(Python) - I cannot import pylab - even though matplotlib, numpy and scipy are already installed (Python) 为什么我已经成功安装了 nltk 却无法导入? - How come I can't import nltk even it's already installed successfully? 运行 python 3.9.4 时,我无法导入 tkinter,但降级到 3.8.2 可以正常工作 - When running python 3.9.4 I am unable to import tkinter, but downgrading to 3.8.2 works perfectly fine pyautogui / pyscreeze 找不到枕头,即使它已成功安装到同一个 package 文件夹中,我可以导入它 - pyautogui / pyscreeze can't find pillow even though it is successfully installed into the same package folder and I can import it protobuf已成功安装但无法导入 - protobuf successfully installed but cannot import import crowdcount to python 即使我安装它也会显示错误 - import crowdcount to python shows error even once i installed it
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM