无法安装matplotlib的底图

时间:2015-04-01 08:47:25

标签: python matplotlib matplotlib-basemap

我尝试为python安装底图。

我安装了几何引擎,如下所示:

export GEOS_DIR=/usr/local
./configure --prefix=$GEOS_DIR
make; make install

然后我安装了这样的PROJ4-9-1:

./configure
make
make install

这一切似乎都很好。至少,没有出现错误。 然后我尝试通过

安装底图
python setup.py install

这给了我一个错误 - 权限被拒绝(还有很多其他错误:

src/_geoslib.c:6023:34: warning: unused function '__Pyx_PyInt_AsSignedChar' [-Wunused-function]
static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {

                             ^
src/_geoslib.c:6042:35: warning: unused function '__Pyx_PyInt_AsSignedShort' [-Wunused-function]
static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {

                       ^
src/_geoslib.c:6061:33: warning: unused function '__Pyx_PyInt_AsSignedInt' [-Wunused-function]
static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {

/usr/local/include/geos_c.h:500:71: note: passing argument to parameter 's' here
extern GEOSGeometry GEOS_DLL *GEOSGeom_createPoint(GEOSCoordSequence* s);

src/_geoslib.c:5339:12: warning: incompatible pointer types passing 'void (char *, char *)' to parameter of type 'GEOSMessageHandler' (aka 'void (*)(const char *, ...)') [-Wincompatible-pointer-types]
initGEOS(__pyx_f_8_geoslib_notice_h, __pyx_f_8_geoslib_error_h);

所以,因为上一个错误是:

running install_lib
copying build/lib.macosx-10.10-intel-2.7/_geoslib.so -> /Library/Python/2.7/site-packages
error: /Library/Python/2.7/site-packages/_geoslib.so: Permission denied

我输入了

sudo python2.7 setup.py install

没有给我任何错误。最后一行是这些

running install_egg_info
Writing /Library/Python/2.7/site-packages/basemap-1.0.7-py2.7.egg-info
running install_clib
customize UnixCCompiler

但是,在python2.7中导入底图给了我:

from mpl_toolkits.basemap import Basemap
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named basemap

显然,它没有安装它...... 有什么想法吗?

0 个答案:

没有答案
相关问题