我在Mac OSX上使用Python3.4,我试图很好地导入。但我无法这样做。这是我回溯:Python不能很好地导入
from shapely.geometry import Point
File "/Users/tc9/Library/Python/3.4/lib/python/site-packages/shapely/geometry/__init__.py", line 4, in <module>
from .base import CAP_STYLE, JOIN_STYLE
File "/Users/tc9/Library/Python/3.4/lib/python/site-packages/shapely/geometry/base.py", line 9, in <module>
from shapely.coords import CoordinateSequence
File "/Users/tc9/Library/Python/3.4/lib/python/site-packages/shapely/coords.py", line 8, in <module>
from shapely.geos import lgeos
File "/Users/tc9/Library/Python/3.4/lib/python/site-packages/shapely/geos.py", line 74, in <module>
_lgeos = load_dll('geos_c', fallbacks=alt_paths)
File "/Users/tc9/Library/Python/3.4/lib/python/site-packages/shapely/geos.py", line 53, in load_dll
libname, fallbacks or []))
OSError: Could not find library geos_c or load any of its variants ['/Library/Frameworks/GEOS.framework/Versions/Current/GEOS', '/opt/local/lib/libgeos_c.dylib']
我想我可能需要设置GEOS_LIBRARY_PATH,但我不知道如何设置它。
这里是/Users/tc9/homebrew/Cellar/geos/3.4.2/lib
的LS我没酿安装后GEOS:
libgeos-3.4.2.dylib
libgeos.dylib
libgeos_c.a
libgeos.a
libgeos_c.1.dylib
libgeos_c.dylib
我编辑和采购我的~/.profile
,但这并没有解决不了的事情:
GEOS_LIBRARY_PATH="/Users/tc9/homebrew/Cellar/geos/3.4.2"
export GEOS_LIBRARY_PATH
可有人点我在一个解决方案,以获得匀称导入?谢谢。
你的DYLD_LIBRARY_PATH是什么?在/ opt/local/lib中有'libgeos_c.dylib'吗? – Evert 2014-09-10 09:31:27
'/ Users/tc9/homebrew/Cellar'可能是brew商店的东西,但它可以作为一个更实用的目录的一个符号链接(没有'Cellar'目录,你知道哪个目录? – Evert 2014-09-10 09:32:51
@Evert echo $ DYLD_LIBRARY_PATH生成一个空白行,我没有设置我的DYLD_LIBRARY_PATH,文件夹/ opt/local/bin存在,但是/ opt/local/lib没有找到/ -name“libgeos_c.dylib”得到/ Users/tc9 /homebrew/Cellar/geos/3.4.2/lib/libgeos_c.dylib和/Users/tc9/homebrew/lib/libgeos_c.dylib – 2014-09-10 09:41:35