3

当我在我的主目录中工作时尝试导入它时,我已经 pip 安装了 folium 并收到此错误:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-af6e4f19ef00> in <module>()
----> 1 import folium

//anaconda/lib/python2.7/site-packages/folium-0.3.0.dev0-      py2.7.egg/folium/__init__.py in <module>()
       3 from __future__ import absolute_import
       4 
 ----> 5 from folium.folium import Map, initialize_notebook, CircleMarker
       6 
       7 from folium.map import (FeatureGroup, FitBounds, Icon, LayerControl, Marker,

  //anaconda/lib/python2.7/site-packages/folium-0.3.0.dev0-  py2.7.egg/folium/folium.py in <module>()
       13 import json
       14 
  ---> 15 from branca.colormap import StepColormap
       16 from branca.utilities import color_brewer
      17 from branca.six import text_type, binary_type

 ImportError: No module named branca.colormap

但是,当我 cd 到 /Library/Python/2.7/site-packages.... 时,我可以将其导入。

4

1 回答 1

5

您是否使用 Anaconda 安装了该软件包?看起来它正在从 Anaconda python 的包安装位置读取包。有几件事要尝试:

  • conda install branca
  • pip install branca
于 2016-03-07T04:08:17.883 回答