ImportError:无法在Python 3.6虚拟环境中导入名称'is_scalar'

问题描述 投票:1回答:1

我已经为python 3.6创建了一个虚拟环境。如matplotlib / basecamp GitHub repository中所述,我已经通过以下命令安装了底图-

pip install --user git+https://github.com/matplotlib/basemap.git

[当我尝试这样导入底图时,

from mpl_toolkits.basemap import Basemap

我得到错误

ImportError: cannot import name 'is_scalar' 

我正在使用Ubuntu 18.04 LTS。

python ubuntu virtualenv matplotlib-basemap
1个回答
0
投票

matplotlib Basemap Github Issues中回答。

看起来您的底图版本较旧。此问题已得到修复,已发布的版本为v1.2.0。

某些注意事项:建议不要使用底图,而要使用cartopy包装。请改用Cartopy。其次,安装底图(或Cartopy)的首选方法是通过conda-forge,因为它的构建过程和依赖性很复杂。

© www.soinside.com 2019 - 2024. All rights reserved.