I got an error
from mpl_toolkits.basemap import Basemap
ModuleNotFoundError: No module named 'mpl_toolkits.basemap'
I put this in
!pip install mpl_toolkits
!conda install -y basemap
I got an error again
KeyError: 'PROJ_LIB'
It seems that environment variables are needed, so I copied the whole code below and pasted it on jupyter
import os
import conda
conda_file_dir = conda.__file__
conda_dir = conda_file_dir.split('lib')[0]
proj_lib = os.path.join(os.path.join(conda_dir, 'share'), 'proj')
os.environ["PROJ_LIB"] = proj_lib
from mpl_toolkits.basemap import Basemap
It was repaired safely!
I referred to here http://hirotaka-hachiya.hatenablog.com/entry/2019/01/27/220047
Recommended Posts