Problems using osgeo in Python

If you get this error:

ImportError: cannot import name 'ogr' from 'osgeo'

The most likely cause, assuming you’ve tried to install osgeo directly, is that you installed osgeo from pip and got this package: (osgeo-0.0.0-py3-none-any.whl) — which, if you look at it, appears to just be blank files. This won’t go so well.

From what I can tell, the correct solution is to install only what’s necessary via the GDAL package. OSGEO should be included in GDAL.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s