无法从“pyproj”导入名称“CRS”以使用 osmnx 库

2024-01-05

I have used a fresh anaconda install to download and install all the required modules for osnmx library but I got the following error: enter image description here


我是 OSMnx 的开发者。该线程中存在越来越多的错误信息和混乱,因此我将为您提供明确的答案。

只需遵循记录即可安装说明 https://osmnx.readthedocs.io/en/stable/#installation安装最新版本的 OSMnx:

conda config --prepend channels conda-forge
conda create -n ox --strict-channel-priority osmnx

如果你安装旧版本的 pyproj + 新版本的 OSMnx,或者旧版本的 OSMnx + 新版本的 pyproj,你会遇到包冲突,例如ImportError多于。如果您只是 conda 安装或 pip 安装而不遵循记录的安装说明,也会出现相同的问题。可以看到需要的依赖版本here https://github.com/gboeing/osmnx/blob/master/requirements.txt。确保您安装了 64 位 python (anaconda/miniconda)。 OSMnx 是纯 Python 的,因此它的安装很简单,but,它依赖于 geopandas,它本身有一些棘手的依赖项需要安装。如果您遵循记录的安装说明,一切都应该顺利且无缝。

总结一下:

  • do只需遵循简单的安装说明 https://osmnx.readthedocs.io/en/stable/#installation在 OSMnx 文档中
  • don't赶紧跑conda install osmnx
  • don't赶紧跑pip install osmnx
  • don't run pip install -U pyproj psutil
  • don't除非您已经安装了 OSMnx 的所有依赖项并确认它们都正常工作,否则根本不要使用 pip (注意:这很重要)

如果您按照文档中的安装说明进行操作但仍然遇到问题,请报告您的操作详细步骤请参见原料 https://github.com/conda-forge/osmnx-feedstock/issues这样我们就可以重现它并快速修复它!

再次,安装说明 https://osmnx.readthedocs.io/en/stable/#installation在文档中。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

无法从“pyproj”导入名称“CRS”以使用 osmnx 库 的相关文章

随机推荐