Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
865 views
in Technique[技术] by (71.8m points)

python 3.x - Cannot import gdal in Spyder

I'm on Windows 10 and I've run a clean install of both Python 3.8, standalone Spyder (no Conda) and GDAL through OSGeo4W64.

I've added the GDAL directory ('C:OSGeo4W64in') to both PATH (via the Windows Environmental Variables Manager) and PYTHONPATH (via the Spyder PYTHONPATH manager).

If I run 'gdalinfo --version' in cmd I get answered with the GDAL version.

If I run from the IPython Console in Spyder '!pip install osgeo' I get answered with 'Requirement already satisfied: osgeo in c:usersmodelstationappdatalocalprogramspythonpython38libsite-packages (0.0.0)'

I've checked that the Spyder interpreter is the same as the one where osgeo is installed by setting it up directly in Spyder

Still, if I run 'from osgeo import gdal' I get 'ModuleNotFoundError: No module named 'osgeo''

What the hell am I exactly supposed to do?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...