0
0

More than 3 years have passed since last update.

Basemapでハマった記録

Last updated at Posted at 2020-09-22

これでエラーが出た

from mpl_toolkits.basemap import Basemap
ModuleNotFoundError: No module named 'mpl_toolkits.basemap'

これを入れてみた

!pip install mpl_toolkits
!conda install -y basemap

またエラーが出た

KeyError: 'PROJ_LIB'

環境変数が必要みたいなので、以下のコードを丸ごとコピーして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

無事に直りました!

こちらを参考にしました
http://hirotaka-hachiya.hatenablog.com/entry/2019/01/27/220047

0
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0