我是使用python在地圖上製作/繪圖的新手,一直試圖按照此博客帖子生成世界地圖(http://sciblogs.co.nz/seeing-數據/ 2011/08/12 /繪圖地理數據上-A-世界地圖與 - 蟒/)。在這裏遇到以下幾件事:安裝Shapely時無法找到OSError geos_c
安裝底圖(用於繪製地理預測數據的Matplotlib擴展)。
from mpl_toolkits.basemap import Basemap Traceback (most recent call last): File "geos_demo.py", line 1, in <module> from mpl_toolkits.basemap import Basemap ImportError: No module named mpl_toolkits.basemap
安裝身材勻稱,但出現以下錯誤[1]:
然後,我走進了geos.py文件並更改geos.dll的所有引用geos_c.dll,建議通過這裏的鏈接: http://osgeo-org.1560.n6.nabble.com/osgeo4w-258-Problems-with-python-shapely-python-2-7-2-td4336816.html
但是,同樣的錯誤[1]發生。
我使用Python 2.7.1和Mac OS 10.7.4。請讓我知道我是否可以提供更多信息,並真正感謝來自社區的任何指導!謝謝!
[1]
from shapely.geometry import Point
Traceback (most recent call last): File "<stdin>", line 1, in <module>
File "/Users/Desktop/python/ENV/lib/python2.7/site-packages/shapely/geometry/__init__.py", line 4, in <module>
from geo import box, shape, asShape, mapping
File "/Users/Desktop/python/ENV/lib/python2.7/site-packages/shapely/geometry/geo.py", line 5, in <module>
from point import Point, asPoint
File "/Users/Desktop/python/ENV/lib/python2.7/site-packages/shapely/geometry/point.py", line 7, in <module>
from shapely.coords import required
File "/Users/Desktop/python/ENV/lib/python2.7/site-packages/shapely/coords.py", line 8, in <module>
from shapely.geos import lgeos
File "/Users/Desktop/python/ENV/lib/python2.7/site-packages/shapely/geos.py", line 59, in <module>
_lgeos = load_dll('geos_c', fallbacks=alt_paths)
File "/Users/Desktop/python/ENV/lib/python2.7/site-packages/shapely/geos.py", line 44, 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']
謝謝@aychedee。我已經安裝numpy,但無法找出底圖。 PythonAnywhere是否幫助將底圖與其他庫一起安裝? – msunbot
嗨米歇爾,其實底圖已經作爲標準包安裝。讓教程完成的唯一區別是您必須將劇情保存爲文件,然後下載而不是直接顯示。 – aychedee