首页 > 解决方案 > 导入 geopandas 时出现 jupyter 错误

问题描述

想问一下,每当我尝试在 jupyter 上导入 geopandas 时,我该如何解决该错误。以下是显示给我的错误消息。我的笔记本电脑在 Python 3 和 Windows 上运行。提前致谢!

    ---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-1-fc7d1d298f0c> in <module>
----> 1 import geopandas

~\anaconda3\anaconda\lib\site-packages\geopandas\__init__.py in <module>
----> 1 from geopandas.geoseries import GeoSeries  # noqa
      2 from geopandas.geodataframe import GeoDataFrame  # noqa
      3 from geopandas.array import _points_from_xy as points_from_xy  # noqa
      4 
      5 from geopandas.io.file import read_file  # noqa

~\anaconda3\anaconda\lib\site-packages\geopandas\geoseries.py in <module>
     10 
     11 import pyproj
---> 12 from shapely.geometry.base import BaseGeometry
     13 from shapely.ops import transform
     14 

~\anaconda3\anaconda\lib\site-packages\shapely\geometry\__init__.py in <module>
      2 """
      3 
----> 4 from .base import CAP_STYLE, JOIN_STYLE
      5 from .geo import box, shape, asShape, mapping
      6 from .point import Point, asPoint

~\anaconda3\anaconda\lib\site-packages\shapely\geometry\base.py in <module>
     16 
     17 from shapely.affinity import affine_transform
---> 18 from shapely.coords import CoordinateSequence
     19 from shapely.errors import WKBReadingError, WKTReadingError
     20 from shapely.geos import WKBWriter, WKTWriter

~\anaconda3\anaconda\lib\site-packages\shapely\coords.py in <module>
      6 from ctypes import byref, c_double, c_uint
      7 
----> 8 from shapely.geos import lgeos
      9 from shapely.topology import Validating
     10 

~\anaconda3\anaconda\lib\site-packages\shapely\geos.py in <module>
    143     if os.getenv('CONDA_PREFIX', ''):
    144         # conda package.
--> 145         _lgeos = CDLL(os.path.join(sys.prefix, 'Library', 'bin', 'geos_c.dll'))
    146     else:
    147         try:

~\anaconda3\anaconda\lib\ctypes\__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error)
    362 
    363         if handle is None:
--> 364             self._handle = _dlopen(self._name, mode)
    365         else:
    366             self._handle = handle

OSError: [WinError 126] The specified module could not be found

错误是发布的错误,我已经使用了几种方法,例如从该站点https://www.lfd.uci.edu/~gohlke/pythonlibs/#fiona下载 whl 文件,但错误仍然存​​在。

标签: jupyter-notebookgeopandas

解决方案


推荐阅读