在没有sudo权限的情况下在linux上安装GEOS库

时间:2016-04-23 12:54:07

标签: python linux geos

我在部门计算机上使用python,但我没有sudo权限。

我尝试import shapely.geometry但我在导入时遇到错误:

OSError: Could not find library geos_c or load any of its variants ['libgeos_c.so.1', 'libgeos_c.so']

然后我尝试安装geos库。我按照以下步骤这样做了:

wget http://download.osgeo.org/geos/geos-3.4.2.tar.bz2
tar xjf geos-3.4.2.tar.bz2

cd nas/local/yangj/geos-3.4.2
./configure --prefix=/nax/local/yangj/geos-3.4.2  --enable-python && make clean && make
make install

然而,在它之后我遇到了一些错误:

test -z "/nas/local/yangj/geos-3.4.2/include/geos/algorithm/locate" || /usr/bin/mkdir -p "/nas/local/yangj/geos-3.4.2/include/geos/algorithm/locate"/usr/bin/mkdir: cannot create directory ‘/nas/local’: Permission denied
make[7]: *** [install-geosHEADERS] Error 1
make[7]: Leaving directory `/local/yangj/geos-3.4.2/include/geos/algorithm/locate'
make[6]: *** [install-am] Error 2
make[6]: Leaving directory `/local/yangj/geos-3.4.2/include/geos/algorithm/locate'
make[5]: *** [install-recursive] Error 1
make[5]: Leaving directory `/local/yangj/geos-3.4.2/include/geos/algorithm/locate'
make[4]: *** [install-recursive] Error 1
make[4]: Leaving directory `/local/yangj/geos-3.4.2/include/geos/algorithm'
make[3]: *** [install-recursive] Error 1
make[3]: Leaving directory `/local/yangj/geos-3.4.2/include/geos'
make[2]: *** [install-recursive] Error 1
make[2]: Leaving directory `/local/yangj/geos-3.4.2/include'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/local/yangj/geos-3.4.2'
make: *** [install] Error 2

有什么想法解决这个问题吗? 此外,我有一种感觉,我应该在安装这个库时设置路径变量,但我对路径设置非常不熟悉。如果您的答案中需要路径设置,您能否清楚解释一下?

0 个答案:

没有答案