osmx 海拔数据:没有名为 'keys' 的模块
osmx elevation data: no module named 'keys'
我来自 R 并且是 Python 的新手,所以我认为这是一个新手问题,但我们将不胜感激。我将按照此示例使用 OSMnx 包将高程数据添加到 Open Streets Map 数据:
https://github.com/gboeing/osmnx-examples/blob/master/notebooks/12-node-elevations-edge-grades.ipynb
当我输入第一段代码时
from keys import my_google_elevation_api_key
我收到这个错误:
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-50-384032deeff7> in <module>()
----> 1 from keys import my_google_elevation_api_key #replace this with your own API key
ModuleNotFoundError: No module named 'keys'
-----------
(注意 - 我正在按照示例中的说明使用 Google 中的 API 键。上面的代码是有意通用的。)我正在使用 jupyter 键入 Python代码。
作者可能有一个 keys.py
,他在其中定义了变量 google_elevation_api_key
并为其分配了一个键,他后来使用该键访问海拔 API。
您可以简单地替换导入行
from keys import my_google_elevation_api_key
有了这个
my_google_elevation_api_key = '<your_api_key>'
我来自 R 并且是 Python 的新手,所以我认为这是一个新手问题,但我们将不胜感激。我将按照此示例使用 OSMnx 包将高程数据添加到 Open Streets Map 数据: https://github.com/gboeing/osmnx-examples/blob/master/notebooks/12-node-elevations-edge-grades.ipynb
当我输入第一段代码时
from keys import my_google_elevation_api_key
我收到这个错误:
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-50-384032deeff7> in <module>()
----> 1 from keys import my_google_elevation_api_key #replace this with your own API key
ModuleNotFoundError: No module named 'keys'
-----------
(注意 - 我正在按照示例中的说明使用 Google 中的 API 键。上面的代码是有意通用的。)我正在使用 jupyter 键入 Python代码。
作者可能有一个 keys.py
,他在其中定义了变量 google_elevation_api_key
并为其分配了一个键,他后来使用该键访问海拔 API。
您可以简单地替换导入行
from keys import my_google_elevation_api_key
有了这个
my_google_elevation_api_key = '<your_api_key>'