为了账号安全,请及时绑定邮箱和手机立即绑定

OSMNX 无法识别任何属性“AttributeError: module 'osmnx'

OSMNX 无法识别任何属性“AttributeError: module 'osmnx'

慕神8447489 2024-01-24 16:08:38
我已经使用 conda config --prependchannels conda-forge、conda create -n ox --strict-channel-priority osmnx 安装了 osmnx。当我尝试使用 osmnx 模块时,没有一个模块正在工作,例如当我使用时:import osmnx as oxplace_name = "Mitte, Hannover, Germany"ox.graph_from_place(place_name, network_type='drive')我收到错误:AttributeError: module 'osmnx' has no attribute 'graph_from_place'当我使用时:import osmnx as oxox.config(use_cache=True, log_console=True)我收到错误:AttributeError: module 'osmnx' has no attribute 'config'等等。没有属性起作用我还尝试根据https://osmnx.readthedocs.io/en/stable/osmnx.html#module-osmnx.graph使用属性,但它也无法解决相同的错误:import osmnx as oxplace_name = "Mitte, Hannover, Germany"ox.graph.graph_from_place(place_name, network_type='all_private')AttributeError: module 'osmnx' has no attribute 'graph'ox环境的python版本是3.8.6和Spyder(4.1.4)。您能帮我找到这些错误的解决方案吗?
查看完整描述

1 回答

?
达令说

TA贡献1821条经验 获得超6个赞

您的桌面上有一个名为的文件osmnx.py,并且正在导入该文件而不是已安装的模块。重命名该文件。



查看完整回答
反对 回复 2024-01-24
  • 1 回答
  • 0 关注
  • 51 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信