我正在尝试在带有底图的地球仪上绘图。但是,我收到以下列出的错误。我该如何让底图正常工作?
Traceback (most recent call last):
File "plotgm.py", line 3, in <module>
from mpltoolkits.basemap import Basemap
ModuleNotFoundError: No module named 'mpltoolkits'
sudo apt install python3-mpltoolkits.basemap
Reading package lists... Done
Building dependency tree
Reading state information... Done
python3-mpltoolkits.basemap is already the newest version (1.1.0+dfsg-1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
答案1
您已mpltoolkits.basemap
安装 Python 3。您是否使用 Python 2 来运行程序?请确保输入
python3 <filename>