我在部门计算机上使用 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
有什么想法可以解决这个问题吗?另外,我感觉安装这个库的时候应该设置路径变量,但是我对路径设置很陌生。如果您的答案中需要设置路径,您能否解释清楚?