我正在尝试使用精彩的PySAL软件包的映射组件,但是由于某些原因,我没有ogr模块。我觉得它与gdal包装在一起。我想念什么吗?
import gdal
import ogr
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-29-ef9eb3418665> in <module>()
----> 1 import gdal
2 import ogr
ImportError: No module named gdal
更新: 恐怕我急着赶飞机,所以我没有提供一些关键信息。我已经使用这里描述的apt-get方法安装了python-gdal ,因为我希望没有机会。程序包管理器是否可能没有正确安装?
choct155@choct155-Q550LF:~$ sudo apt-get install python-gdal
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-gdal is already the newest version.
The following packages were automatically installed and are no longer required:
firefox-globalmenu libfftw3-3 libgeos-3.3.3 libogdi3.2 libxerces-c28
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 33 not upgraded.
恐怕我也找不到osgeo ...
from osgeo import gdal
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-28-a04b80bf4e65> in <module>()
----> 1 from osgeo import gdal
ImportError: No module named osgeo
另外,我应该补充一点,我正在使用Ubuntu 13.04。
我有同样的问题,我安装了gdal(它说它在/usr/bin/python2.7/dist-packages中。如果运行的脚本具有“ from osgeo import gdal”,我会收到以下错误消息:'ImportError :没有名为osgeo'的模块。您设法弄清楚了吗