简体   繁体   English

Conda 环境和 Jupyter 笔记本,Python 3.9.2

[英]Conda Environment and Jupyter Notebook, Python 3.9.2

My Conda Environments are not showing up in my Jupiter Notebooks.我的 Conda 环境没有出现在我的 Jupiter Notebooks 中。 I've reviewed all the (excellent) dialogue here , but it doesn't appear to work for python 3.9.2.我在这里查看了所有(优秀的)对话,但它似乎不适用于 python 3.9.2。

I tried the following, which didn't work:我尝试了以下方法,但没有奏效:

conda install jupyter
conda install ipykernel
conda install nb_conda

Then when I try the following conda install nb_conda_kernels I get the following error:然后,当我尝试以下conda install nb_conda_kernels时,出现以下错误:

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.

How can I get my conda environments to show in jupyter notebooks in python 3.9.2?如何让我的 conda 环境显示在 python 3.9.2 的 jupyter 笔记本中? Thank you!谢谢!

Try using the conda-forge channel, eg:尝试使用 conda-forge 频道,例如:

$ conda install -c conda-forge ipykernel

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 只是要添加的 kernel,那么您不需要安装jupyter ,如果这是您想要做的。

After that, you need to run this in that conda env:之后,您需要在该 conda env 中运行它:

$ python -m ipykernel install --user --name vanilla --display-name "Python 3 (vanilla)"

Replace the name and display-name to your liking.根据您的喜好替换名称和显示名称。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM