通过cmd线向jupyter添加conda环境不起作用 [英] adding conda environment via cmd line to jupyter doesn't work
问题描述
试图使OSMnx进入jupyter conda环境. 但是conda环境设置不正确.
Trying to get OSMnx into jupyter conda environment. But conda environment not set correctly.
在命令行上:
- 使用OSMnx安装步骤创建的conda环境
- 我克隆了环境,将其重命名为"realestate"
- 将房地产添加到Jupyter:
> conda activate realestate
> conda install -c anaconda ipykernel
> python -m ipykernel install --user --name=realestate
> which python
/opt/anaconda3/envs/realestate/bin/python
在Jupyter上显示了房地产环境...但是当我跑步时
On Jupyter the realestate environment shows up... but when I run
!which python
我知道
/opt/anaconda3/bin/python
我已经在Jupyter(Conda)内创建了一些conda环境,它们显示为
I've created some conda environments inside of Jupyter(Conda) and they show up as
Python [conda env: otherenv]
然后产生正确的路径
!which python
/opt/anaconda3/envs/otherenv/bin/python
我想念什么?
PS. OSMnx安装不是简单的conda安装
PS. OSMnx install is not a simple conda install
conda config --prepend channels conda-forge
conda create -n ox --strict-channel-priority osmnx
推荐答案
据我所知,这听起来像是您正在尝试将OSMnx,Jupyter以及anaconda metapackage中的所有软件包一起安装在单个conda中.环境.如果是这样,只需在一行中创建所有包含这些软件包的conda环境,然后在其中安装ipython kernelspec:
From what I can tell, it sounds like you're trying to have OSMnx, Jupyter, and all the packages in the anaconda metapackage installed together in a single conda environment. If so, just create the conda environment with all those packages in one line, then install the ipython kernelspec in it:
conda config --prepend channels conda-forge
conda create -n realestate --strict-channel-priority osmnx anaconda jupyter
conda activate realestate
python -m ipykernel install --sys-prefix --name realestate --display-name "Python (realestate)"
jupyter kernelspec list
这篇关于通过cmd线向jupyter添加conda环境不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!