Tôi là người mới tạo/vẽ trên bản đồ với python, đang cố gắng theo dõi blog này để tạo bản đồ thế giới (http://sciblogs.co.nz/seeing- dữ liệu/2011/08/12/âm mưu-địa lý-dữ liệu-on-a-world-map-với-python /). Bị kẹt với một số thứ ở đây:Không thể tìm thấy OSError geos_c khi Cài đặt Shapely
Cài đặt sơ đồ cơ sở (phần mở rộng Matplotlib để vẽ dữ liệu trên dự báo địa lý).
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
Cài đặt kiểu dáng cân đối, nhưng các lỗi sau xảy ra [1]:
Sau đó, tôi đi vào các tập tin geos.py và thay đổi tất cả các tài liệu tham khảo của geos.dll để geos_c.dll, theo khuyến cáo theo liên kết tại đây: http://osgeo-org.1560.n6.nabble.com/osgeo4w-258-Problems-with-python-shapely-python-2-7-2-td4336816.html
Tuy nhiên, cùng một lỗi [1] xảy ra.
Tôi đang sử dụng Python 2.7.1 và Mac OS 10.7.4. Vui lòng cho tôi biết nếu tôi có thể cung cấp thêm thông tin và thực sự đánh giá cao bất kỳ hướng dẫn nào từ cộng đồng tại đây! Cảm ơn!
[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']
Cảm ơn @aychedee.Tôi đã cài đặt numpy và không thể tìm ra basemap. PythonAnywhere có giúp cài đặt bản đồ cơ sở cùng với các thư viện khác không? – msunbot
Xin chào Michelle, sơ đồ trang web thực sự đã được cài đặt như một gói tiêu chuẩn. Sự khác biệt duy nhất trong việc hướng dẫn hoàn thành đó là bạn sẽ phải lưu cốt truyện dưới dạng tệp và sau đó tải xuống thay vì hiển thị trực tiếp. – aychedee