微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在新环境中安装但 OSMnx:Fiona 错误 - 模块“fiona”没有属性“_loading”

如何解决在新环境中安装但 OSMnx:Fiona 错误 - 模块“fiona”没有属性“_loading”

我正在按照 Geoffboeing 网站的步骤在新环境中安装 OSMnx:https://geoffboeing.com/2017/02/python-getting-started/

激活环境并导入OSMnx模块后,提示fiona的错误

AttributeError                            Traceback (most recent call last)
<ipython-input-2-28b0d4205d5c> in <module>()
----> 1 import osmnx as ox
      2 get_ipython().magic('matplotlib inline')
      3 #import geopandas as gpd

C:\Users\Kirti\anaconda3\envs\ox\lib\site-packages\osmnx\__init__.py in <module>()
      7 ################################################################################
      8 
----> 9 from .buildings import *
     10 from .elevation import *
     11 from .core import *

C:\Users\Kirti\anaconda3\envs\ox\lib\site-packages\osmnx\buildings.py in <module>()
      7 
      8 import time
----> 9 import geopandas as gpd
     10 import matplotlib.pyplot as plt
     11 from matplotlib.collections import PatchCollection

C:\Users\Kirti\anaconda3\envs\ox\lib\site-packages\geopandas\__init__.py in <module>()
      5 from geopandas.array import points_from_xy  # noqa
      6 
----> 7 from geopandas.io.file import _read_file as read_file  # noqa
      8 from geopandas.io.arrow import _read_parquet as read_parquet  # noqa
      9 from geopandas.io.arrow import _read_feather as read_feather  # noqa

C:\Users\Kirti\anaconda3\envs\ox\lib\site-packages\geopandas\io\file.py in <module>()
     10 
     11 try:
---> 12     import fiona
     13 
     14     fiona_import_error = None

C:\Users\Kirti\anaconda3\envs\ox\lib\site-packages\fiona\__init__.py in <module>()
     83 
     84 import fiona._loading
---> 85 with fiona._loading.add_gdal_dll_directories():
     86     from fiona.collection import BytesCollection,Collection
     87     from fiona.drvsupport import supported_drivers

AttributeError: module 'fiona' has no attribute '_loading'

我尝试安装 OSMnx 已过去一周,但仍然无法

  1. 仅从一个渠道安装 Conda forge
  2. 这是全新的,重新安装了 anaconda
  3. 因此,没有旧模块冲突
  4. 新环境

在进一步单独安装单个模块之前,会导致 GDAL 和其他模块之间的版本冲突。我想问一下是否有人有解决方案或者我该怎么做?

我采取了几乎所有措施,但仍然无济于事。我是新手,我不确定下载 .whl 文件内容

这是我在这个环境中的 conda 列表

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

Python 版本是:Python 3.9.0 (在那个环境中)

提前致谢。

解决方法

如果您想安装 OSMnx,只需按照其当前记录的 installation instructions。多年来,博客文章可能会过时。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。