[英]New conda environments no longer being recognised in Jupyter Notebook
Whenever I have previously run Jupyter notebooks from within an activated conda environment, the environment is available within Jupyter.每当我之前在激活的 conda 环境中运行 Jupyter 笔记本时,该环境在 Jupyter 中可用。 However, now when I do this with any newly created environment this doesn't work anymore.
但是,现在当我对任何新创建的环境执行此操作时,它不再起作用了。 If I use a previously created environment I can access the environment through Jupyter, it is only newly created environments which don't work!
如果我使用以前创建的环境,我可以通过 Jupyter 访问该环境,只有新创建的环境不起作用!
I have tried installing nb_conda_kernels ipykernel and ipywidgets as described in another stack overflow question but this also doesn't solve the issue.我已经尝试按照另一个堆栈溢出问题中的描述安装 nb_conda_kernels ipykernel 和 ipywidgets ,但这也不能解决问题。
Any ideas how I can get this working again and which packages might not be installed for this to work?有什么想法可以让我再次工作,以及哪些软件包可能没有安装以使其工作?
Edit: If I follow the top answer on this post Conda environments not showing up in Jupyter Notebook then the environment becomes available.编辑:如果我按照这篇文章的最佳答案Conda 环境未出现在 Jupyter Notebook 中,则该环境可用。 However I would need to run this for every new environment!
但是,我需要为每个新环境运行它! Any reason this behavior could have changed?
这种行为可能改变的任何原因?
Try this尝试这个
conda create --name firstEnv
conda activate firstEnv
conda install -c anaconda ipykernel
python -m ipykernel install --user --name=firstEnv
对于其他遇到此问题的人,我通过在基本 conda 环境中重新安装 Jupyter 和 Ipykernel 包来解决此问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.