IPython无法导入Geopandas

2024-04-19 21:38:42 发布

您现在位置:Python中文网/ 问答频道 /正文

从conda forge成功安装Geopandasconda包后,如下所示:

conda install -c conda-forge geopandas

当我尝试将其导入IPython(Jupyter notebook)时,使用:

^{pr2}$

尽管所有依赖项(numpy、pandas、shapely、fiona、six、pyproj)都已安装并处于最新状态,但我始终收到以下错误:

---------------------------------------------------------------------
------
ImportError                               Traceback (most recent call 
last)
<ipython-input-1-13760ce748ee> in <module>()
      4 import matplotlib.mlab as mlab
      5 
----> 6 import geopandas as gpd
      7 import seaborn as sns
      8 from sklearn import preprocessing

    //anaconda/lib/python2.7/site-packages/geopandas/__init__.py in <module>()
----> 1 from geopandas.geoseries import GeoSeries
      2 from geopandas.geodataframe import GeoDataFrame
      3 
      4 from geopandas.io.file import read_file
      5 from geopandas.io.sql import read_postgis

//anaconda/lib/python2.7/site-packages/geopandas/geoseries.py in <module>()
      6 from pandas import Series, DataFrame
      7 from pandas.core.indexing import _NDFrameIndexer
----> 8 from pandas.util.decorators import cache_readonly
      9 import pyproj
      10 from shapely.geometry import box, shape, Polygon, Point

ImportError: No module named decorators

关于可能导致错误的原因有什么建议吗?在


Tags: infromimportpandasas错误anacondaconda
1条回答
网友
1楼 · 发布于 2024-04-19 21:38:42

为了让Jeff的评论更加突出,在pandas 0.20.1中进行了修复。
因此,通常情况下,如果您现在安装的是最新的pandas版本(而不是0.20.0),则不会出现此错误。

相关问题 更多 >