我已经安装了带有conda config的osmnx --prepend channel conda-forge,conda create -n ox --strict-channel-priority osmnx。当我尝试使用osmnx模块时,没有一个模块在工作,例如,当我使用:
import osmnx as ox
place_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 ox
ox.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 ox
place_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)。你能帮我找出这些错误的解决方案吗?
发布于 2020-11-01 22:56:48
您的桌面上有一个名为osmnx.py的文件,并且正在导入该文件,而不是导入已安装的模块。重命名该文件。
https://stackoverflow.com/questions/64591081
复制相似问题