我正在使用 Mac,并且可以从终端访问 osmnx;但是,osmnx 的功能不能从 spyder 运行。我正在尝试在脚本中使用 osmnx 来自动化该过程。当我尝试运行一个简单的脚本时,例如:
import osmnx as ox
graph = ox.load_graphml('NL_motorway.graphml')
我收到以下错误:
File "", line 1, in
runfile('/Users/salilsharma/surfdrive/My Documents/python/Ksp/osmnx.py', wdir='/Users/salilsharma/surfdrive/My Documents/python/Ksp')
File "/anaconda3/lib/python3.6/site-packages/spyder/utils/site/sitecustomize.py", line 705, in runfile
execfile(filename, namespace)
File "/anaconda3/lib/python3.6/site-packages/spyder/utils/site/sitecustomize.py", line 102, in execfile
exec(compile(f.read(), filename, 'exec'), namespace)
File "/Users/salilsharma/surfdrive/My Documents/python/Ksp/osmnx.py", line 9, in
import osmnx as ox
File "/Users/salilsharma/surfdrive/My Documents/python/Ksp/osmnx.py", line 11, in
graph = ox.load_graphml('NL_motorway.graphml')
AttributeError: module 'osmnx' has no attribute 'load_graphml'
我正在使用以下软件。操作系统:MacOS Mojave 10.14.1、python 3.6.5、OSMNX 版本 0.8.2。