2

i have a problem after installing Basemap 1.0.6. I'm running a virtualenv, first a activated my virtualenv, went into my home directory and downloaded the latest Basemap version. Then i installed it via pip using:

pip install basemap-1.0.6.tar.gz

all works fine. then i exported my GEOS_DIR to /usr/local/ because my libgeos_c and geos_c.h stored there.

Then i tried to run the simpletest.py in the folder /home/fv/basemap-1.0.6/examples/, after that i got the error:

    Traceback (most recent call last):
  File "simpletest.py", line 1, in <module>
    from mpl_toolkits.basemap import Basemap
  File "/home/fv/virtualenv/20130426/lib/python3.3/site-packages/mpl_toolkits/basemap/__init__.py", line 31, in <module>
    from mpl_toolkits.axes_grid1 import make_axes_locatable
ImportError: No module named 'mpl_toolkits.axes_grid1'

im running centos,

i hope anyone can help me? :)

4

2 回答 2

4

怀疑您必须升级(或安装)您的 matplotlib 版本。

于 2013-05-28T06:21:15.413 回答
0

我不认为这真的是一个版本问题。我对底图 1.0.7 和 mpl 1.1.1rc 也有同样的问题。奇怪的是,我对这个组合没有任何问题。然后我删除了我的 .local 文件夹并重新安装了底图(mpl 安装为 Ubuntu 包)。最后,它说:

Skipping installation of /home/me/.local/lib/python2.7/site-packages/mpl_toolkits/__init__.py (namespace package)

但我之前的安装(我备份了旧的 .local 文件夹)实际上有一个init .py 文件。一旦我复制了旧文件,它就起作用了。内容是:

try:
    __import__('pkg_resources').declare_namespace(__name__)
except ImportError:
    pass # must not have setuptools

此外,旧文件夹有一个basemap-1.0.7.egg-info文件,而新文件夹有一个

于 2014-01-09T10:09:17.887 回答