问题描述
我使用以下代码通过conda下载了osmnx:
I downloaded osmnx via conda using the code:
conda config --prepend channels conda-forge
conda create -n ox --strict-channel-priority osmnx
这来自osmnx文档: https://osmnx.readthedocs.io/en/stable/
This comes from the osmnx documentation: https://osmnx.readthedocs.io/en/stable/
我可以看到该模块已下载,因为在Anaconda提示中,我可以键入conda activate ox
并且它可以工作.但是,当我进入Jupyter笔记本并输入
I can see the module has downloaded because in the Anaconda Prompt I can type conda activate ox
and it works. However when I go into my jupyter notebook and type
import osmnx as ox
我收到以下错误:
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-11-7e05e48535cd> in <module>
----> 1 import osmnx as ox
2
3
ModuleNotFoundError: No module named 'osmnx'
请告知我该怎么做.谢谢
Please advise as to what I can do. Thanks
推荐答案
在您的终端中,运行:
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和JupyterLab安装到名为ox
的conda环境中,激活环境,安装ipython 内核,然后启动JupyterLab.
This installs OSMnx and JupyterLab into a conda environment called ox
, activates the environment, installs an ipython kernel in the environment, then launches JupyterLab.
另请参见
- 未在Jupyter Notebook中显示的Conda环境
- 未在Jupyter Notebook中显示的Conda环境
- 如何在conda环境中使用Jupyter笔记本?/a>
- 如何将conda环境添加到jupyter实验室
- 将Conda环境与Jupyter Notebook链接
- Jupyter在哪个conda环境中执行?
- Conda environments not showing up in Jupyter Notebook
- Conda environments not showing up in Jupyter Notebook
- How to use Jupyter notebooks in a conda environment?
- How to add conda environment to jupyter lab
- Link Conda environment with Jupyter Notebook
- In which conda environment is Jupyter executing?
这篇关于OSMnx不会在Juypter Notebook中打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!