Soy un novato en hacer/trazar en mapas con python, he intentado seguir este blog para generar un mapa mundial (http://sciblogs.co.nz/seeing- data/2011/08/12/plotting-geographic-data-on-a-world-map-with-python /). Nos quedamos atrapados con algunas cosas aquí:OSError geos_c no se pudo encontrar al instalar Shapely
Instalación de mapa base (una extensión Matplotlib para el trazado de datos en las proyecciones geográficas).
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
Instalar bien proporcionado, pero el siguiente error [1]:
Luego entré en el archivo geos.py y cambiar todas las referencias de geos.dll a geos_c.dll, tal como se recomienda por el enlace aquí: http://osgeo-org.1560.n6.nabble.com/osgeo4w-258-Problems-with-python-shapely-python-2-7-2-td4336816.html
Sin embargo, se produce el mismo error [1].
Estoy usando Python 2.7.1 y Mac OS 10.7.4. Por favor, avíseme si puedo proporcionar información adicional y realmente aprecio cualquier orientación de la comunidad aquí. ¡Gracias!
[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']
Gracias @aychedee.He instalado numpy y no pude descifrar el mapa base. ¿PythonAnywhere ayuda a instalar el mapa base junto con las otras bibliotecas? – msunbot
Hola Michelle, en realidad el mapa base ya está instalado como un paquete estándar. La única diferencia en completar ese tutorial sería que tendría que guardar el diagrama como un archivo y luego descargarlo en lugar de mostrarlo directamente. – aychedee