I am trying to run a Python script test.py to test the gdal library. The script contains the line:
from osgeo import gdal
At that line I get the traceback:
File "~/test.py", line 9, in <module>
from osgeo import gdal
File "/usr/local/lib/python2.7/site-packages/GDAL-2.2.0/osgeo/__init__.py", line 21, in <module>
gdal = swing_import_helper()
File "/usr/local/lib/python2.7/site-packages/GDAL-2.2.0/osgeo/__init__.py", line 13, in swig_import_helper
import gdal
ImportError: No module named _gdal
I don't see any _gdal Python files or any scripts that define _gdal. Do I need to install another (prerequisite) library that defines _gdal? The GDAL package should include everything needed to install the library and run scripts that import gdal.