我在鬼魂上安装了GDAL,命令如下:
$ mkdir src
$ cd scr
$ svn checkout https://svn.osgeo.org/gdal/branches/1.10/gdal gdal
$ cd gdal
$ ./configure --with-python=/usr/local/bin/python2.7
$ make
$ make install现在,如果我尝试导入GDAL,我会得到以下错误:
>>> from osgeo import gdal
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ustroetz/lib/python2.7/GDAL-1.10.1-py2.7-linux-x86_64.egg/osgeo/__init__.py", line 21, in <module>
_gdal = swig_import_helper()
File "/home/ustroetz/lib/python2.7/GDAL-1.10.1-py2.7-linux-x86_64.egg/osgeo/__init__.py", line 17, in swig_import_helper
_mod = imp.load_module('_gdal', fp, pathname, description)
ImportError: /home/ustroetz/lib/python2.7/GDAL-1.10.1-py2.7-linux-x86_64.egg/osgeo/_gdal.so: undefined symbol: GDALUseTransformer但是,如果cd转到lib并在那里尝试,它就可以正常工作:
>>> from osgeo import gdal
>>> 我必须设置什么才能在网络功能中的任何地方使用它?
我的lib文件夹包含以下内容:
$ ls
gdalplugins libgdal.la libgdal.so.1 python2.4 python2.7
libgdal.a libgdal.so libgdal.so.1.17.1 python2.5发布于 2014-04-04 04:27:24
我让它与下面的代码一起工作:
~/.bashrc。您可以通过在命令行中键入以下命令来执行此操作:对以下内容执行$ vi ~/.bashrc
export LD_LIBRARY_PATH=/home/your username/lib
:x
https://stackoverflow.com/questions/22847728
复制相似问题