简体   繁体   English

最近发生的 geopandas 导入错误

[英]Recently occurring geopandas import error

I have been using geopandas for a while now and have never seen this error.我已经使用geopandas一段时间了,从来没有见过这个错误。 Since last few weeks, I am noticing a geopandas import error.自过去几周以来,我注意到geopandas导入错误。 Did anything change recently with the package? package 最近有什么变化吗? What does keyerror MISSING mean? keyerror MISSING是什么意思?

Package details: Package 详细信息:

Name: geopandas
Version: 0.9.0
Summary: Geographic pandas extensions
Home-page: http://geopandas.org
Author: GeoPandas contributors
Author-email: kjordahl@alum.mit.edu
License: BSD


Name: pygeos
Version: 0.9
Summary: GEOS wrapped in numpy ufuncs
Home-page: https://github.com/pygeos/pygeos
Author: Casper van der Wel
Author-email: caspervdw@gmail.com
License: BSD 3-Clause


Traceback (most recent call last)

KeyError
<ipython-input-4-6f0517744ee1> in <module>
     38 #import gdal as gdal
     39 #from osgeo import ogr
---> 40 import geopandas as gpd
     41 from shapely.geometry import Point
     42 from shapely.geometry import Polygon

~/opt/anaconda3/lib/python3.8/site-packages/geopandas/__init__.py in <module>
      1 from geopandas._config import options  # noqa
      2 
----> 3 from geopandas.geoseries import GeoSeries  # noqa
      4 from geopandas.geodataframe import GeoDataFrame  # noqa
      5 from geopandas.a
~/opt/anaconda3/lib/python3.8/site-packages/geopandas/_vectorized.py in <module>
 
~/opt/anaconda3/lib/python3.8/site-packages/geopandas/_vectorized.py in <dictcomp>(.0)
     37 
     38 if compat.USE_PYGEOS:
---> 39     type_mapping = {p.value: _names[p.name] for p in pygeos.GeometryType}
     40     geometry_type_ids = list(type_mapping.keys())
     41     geometry_type_values = np.array(list(type_mapping.values()), dtype=object)

KeyError: 'MISSING'

This is a compatibility issue with older GeoPandas (0.8.1 and older) and newer pygeos (0.9).这是与较旧的 GeoPandas(0.8.1 和更早版本)和较新的 pygeos(0.9)的兼容性问题。 Make sure you use both packages in their latest versions (0.9.0 for both at this moment).确保您使用这两个软件包的最新版本(此时两者均为 0.9.0)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM