本文介绍了为什么我不能导入folium python包?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了folium,并在我在主目录中工作时尝试将其导入时出现此错误:

I've pip installed folium and get this error when I try to import it in when Im working in my home directory:

---------------------------------------------------------------------------
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 ...时,我可以将其导入....有什么用?

However, i can import it when I cd to /Library/Python/2.7/site-packages.... What gives?

推荐答案

您是否使用Anaconda安装了该软件包?好像是从Anaconda python的软件包安装位置中读取软件包.可以尝试的几件事:

Did you install the package with Anaconda? It looks like it's reading the package from Anaconda python's package install locations. A few things to try:

  • conda install branca
  • pip install branca

这篇关于为什么我不能导入folium python包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-26 15:07