juypter笔记本中可以加载osmnx

发布于 2025-02-13 01:19:13 字数 958 浏览 3 评论 0原文

我无法将OSMNX导入我的Jupyter笔记本(Python版本3.8.8)。我已经运行以下代码:

conda config --prepend channels conda-forge
conda create -n ox --strict-channel-priority osmnx jupyterlab
conda activate ox
python -m ipykernel install --user --name ox --display-name "Python (ox)"
jupyter lab

它只是在新的选项卡中打开新笔记本,而OSMNX仅在该选项卡中使用。我希望能够将OSMNX安装到我已经保存的笔记本中。我在工作选项卡中尝试了这一点

pip install osmnx

,但它给出了错误:

  File "<ipython-input-9-8ead41cb7306>", line 3
    pip install osmnx
        ^
SyntaxError: invalid syntax

import osmnx as ox

给出错误:

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-11-d4a103aeed40> in <module>
----> 1 import osmnx as ox

ModuleNotFoundError: No module named 'osmnx' 

您可能会认为“只使用新标签”,但是新的选项卡非常慢(实际上不正常),我也无法保存它。

有人知道如何成功将OSMNX导入jupyter笔记本电脑吗?

I can't import osmnx into my jupyter notebook (python version 3.8.8). I've run the following code:

conda config --prepend channels conda-forge
conda create -n ox --strict-channel-priority osmnx jupyterlab
conda activate ox
python -m ipykernel install --user --name ox --display-name "Python (ox)"
jupyter lab

Which just opens a new notebook in a new tab and osmnx only works in that tab. I'm looking to be able to install osmnx into my already saved notebook. I tried this in my working tab

pip install osmnx

but it gives the error:

  File "<ipython-input-9-8ead41cb7306>", line 3
    pip install osmnx
        ^
SyntaxError: invalid syntax

and

import osmnx as ox

gives the error:

ModuleNotFoundError                       Traceback (most recent call last)
<ipython-input-11-d4a103aeed40> in <module>
----> 1 import osmnx as ox

ModuleNotFoundError: No module named 'osmnx' 

You might think "just use the new tab" but the new tab is incredibly slow (it's practically not functioning) and I can't save it either.

Anyone know how to successfully import osmnx into a jupyter notebook?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文