问题
I am trying to install basemap on my Mac. I followed the steps listed here: https://matplotlib.org/basemap/users/installing.html#installation
Everything seemed to go well until I tried to test the install by typing into the python prompt:
>>>from mpl_toolkits.basemap import Basemap
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.7/site-
packages/mpl_toolkits/basemap/__init__.py", line 33, in <module>
from mpl_toolkits.axes_grid1 import make_axes_locatable
ImportError: No module named axes_grid1
I saw another post that suggested updating matplot lib with:
sudo pip install --upgrade matplotlib
I tried that to no avail. Any other suggestions would be greatly appreciated.
回答1:
pip install --upgrade --user matplotlib numpy pyproj pyshp OWSLib Pillow
sudo apt install libgeos-dev
pip install --user --upgrade basemap-1.2.0rel.tar.gz
I have recently used the instructions above to update basemap on Ubuntu 18.04. I am not sure about the equivalent for macOS though. The basemap archive can be downloaded here.
来源:https://stackoverflow.com/questions/52862189/matplotlib-basemap-install-issues-mac-os