【问题标题】:Installation Error: installing basemap on windows安装错误:在 Windows 上安装底图
【发布时间】:2018-09-20 23:44:48
【问题描述】:

我正在尝试安装底图,使用它似乎效果很好,

conda install -c conda-forge basemap

在 anaconda 提示符下。但是,当我在 jupyternotebook 上输入此代码时,

import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap

显示错误:

FileNotFoundError                         Traceback (most recent call last)
<ipython-input-2-4fc84cbcc854> in <module>()
  1 import matplotlib.pyplot as plt
----> 2 from mpl_toolkits.basemap import Basemap

~\Documents\DataScience\data\lib\site- 
packages\mpl_toolkits\basemap\__init__.py in <module>()
144 
145 # create dictionary that maps epsg codes to Basemap kwargs.
--> 146 epsgf = open(os.path.join(pyproj.pyproj_datadir,'epsg'))
147 epsg_dict={}
148 for line in epsgf:

FileNotFoundError: [Errno 2] No such file or directory: 'epsg'

【问题讨论】:

    标签: python installation matplotlib-basemap


    【解决方案1】:

    看起来 matplotlib 试图访问一些不在同一个 conda 包中的信息。

    根据this comment的一个问题,epsg数据在一个包proj4中,你必须设置环境变量PROJ_LIB以便matplotlib找到它。

    【讨论】:

      猜你喜欢
      • 2017-04-14
      • 2017-09-10
      • 2015-07-24
      • 1970-01-01
      • 1970-01-01
      • 2013-05-13
      • 2014-09-07
      • 2013-11-02
      • 2015-11-01
      相关资源
      最近更新 更多