Conda Environment and Jupyter Notebook, Python 3.9.2(Conda 环境和 Jupyter Notebook,Python 3.9.2)
问题描述
我的 Conda 环境没有出现在我的 Jupiter Notebooks 中.我已经在这里查看了所有(优秀的)对话,但它似乎不适用于 python 3.9.2.
My Conda Environments are not showing up in my Jupiter Notebooks. I've reviewed all the (excellent) dialogue here, but it doesn't appear to work for python 3.9.2.
我尝试了以下方法,但没有成功:
I tried the following, which didn't work:
conda install jupyter
conda install ipykernel
conda install nb_conda
然后当我尝试以下 conda install nb_conda_kernels 我得到以下错误:
Then when I try the following conda install nb_conda_kernels I get the following error:
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: |
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed
UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:
Specifications:
- nb_conda_kernels -> python[version='>=2.7,<2.8.0a0|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0|>=3.8,<3.9.0a0']
Your python: python=3.9
If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.
如何让我的 conda 环境在 python 3.9.2 的 jupyter 笔记本中显示?谢谢!
How can I get my conda environments to show in jupyter notebooks in python 3.9.2? Thank you!
推荐答案
尝试使用 conda-forge 频道,例如:
Try using the conda-forge channel, e.g.:
$ conda install -c conda-forge ipykernel
如果这个 conda env 只是一个要添加的内核,你不需要安装 jupyter,如果这是你想做的.
And you don't need to install jupyter if this conda env is just a kernel to add, if that's what you want to do.
之后,您需要在 conda env 中运行它:
After that, you need to run this in that conda env:
$ python -m ipykernel install --user --name vanilla --display-name "Python 3 (vanilla)"
根据自己的喜好替换名称和显示名称.
Replace the name and display-name to your liking.
这篇关于Conda 环境和 Jupyter Notebook,Python 3.9.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Conda 环境和 Jupyter Notebook,Python 3.9.2
基础教程推荐
- 与常规 dict 相比,Python manager.dict() 非常慢 2022-01-01
- 将 x 轴刻度更改为自定义字符串 2022-01-01
- 在 Celery 工作人员中捕获 Heroku SIGTERM 以优雅地关 2022-01-01
- pyserial - 可以从线程 a 写入串行端口,是否阻塞从线程 b 读取? 2022-01-01
- 用 Python 编写 Fortran 无格式文件 2022-01-01
- 使用生成器和迭代器时 Python 多循环失败 2022-01-01
- 由Python将MP3转换为MIDI(类型错误:无法加载插件:mtg-Melodia:Melodia) 2022-01-01
- 尝试制作WhatsApp机器人 2022-01-01
- Discord.py 缺少必需的参数 2022-01-01
- numpy float:比算术运算中内置的慢 10 倍? 2022-01-01
