python - 已安装 gdal 但无法在 Jupyter Notebook 中使用

标签 python jupyter-notebook gdal

我在我的 Jupyter 终端中使用 conda install -c conda-forge gdal 安装了 gdal,但是当我运行以下代码时:

import gdal
gdal.Open('/Users/alyse/ldem.img') 
gdal.Translate('/Users/alyse/ldem.img')
mpimg.read('/Users/alyse/ldem.img')

我收到以下错误:ModuleNotFoundError: No module named 'gdal'.
哭泣。如果有人有任何建议,我将不胜感激!我是编码初学者。

最佳答案

试试这个:from osgeo import gdal,它对我有用。

关于python - 已安装 gdal 但无法在 Jupyter Notebook 中使用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63056846/

相关文章:

python - urllib.request.urlretrieve 不通过 HTTPS 下载文件

python - 在 Internet Explorer 的 Jupyter Notebook 中不显示 Folium 热图

ipython - Jupyterhub终端路径变量

python - Windows 上的 GeoDjango : Try setting GDAL_LIBRARY_PATH in your settings

gis - gdal/ogr : How to really crop a shapefile?

python - 如何将 seaborn 图保存为 svg 或 png

Python子进程?

python - 如何从DataFrame的日期列中提取月份名称和年份

python - 如何使用这些数据制作直方图?

c++ - 链接 vs 2012 c++ GDAL