简体   繁体   English

Anaconda python 环境从 VS 代码中消失

[英]Anaconda python environment disappeared from VS code

Used to be able to use anaconda python in VS code (ubuntu 20.04).曾经能够在 VS 代码(ubuntu 20.04)中使用 anaconda python。 Now the VS code option for Conda environments disappeared and I'm not sure why.现在,Conda 环境的 VS 代码选项消失了,我不确定为什么。 Reloading the VS code/rebooting the computer sometimes gives me back the conda environment.重新加载 VS 代码/重新启动计算机有时会让我回到 conda 环境。 But it will disappear again when I open another.ipynb file.但是当我打开另一个.ipynb 文件时它会再次消失。

This happened after me opening a jupyter notebook file on a mounted SFTP server, direclty from the files app.这是在我直接从文件应用程序打开已安装的 SFTP 服务器上的 jupyter notebook 文件之后发生的。 That notebook worked fine actually.那本笔记本实际上工作得很好。 After closing that notebook, I cannot see my conda environment in other notebooks.关闭该笔记本后,我在其他笔记本中看不到我的 conda 环境。

I tried loading the python enviroments by pressing "Ctrl + Shift + P".我尝试通过按“Ctrl + Shift + P”加载 python 环境。 There I can see all python environments and can select anyone I like.在那里我可以看到所有 python 环境,也可以看到 select 任何我喜欢的人。 I can also run ".py" scripts without a problem.我也可以毫无问题地运行“.py”脚本。 But in Jupyter notebook I cannot select the Conda environments.但是在 Jupyter notebook 中我不能 select Conda 环境。

Thanks a lot for the comments, Since I want to use the anaconda environment, not my current environment.非常感谢您的评论,因为我想使用 anaconda 环境,而不是我当前的环境。 a clean uninstall/reinstall worked for me in the end.干净的卸载/重新安装最终对我有用。 I'm using Ubuntu 20.04 and followed the instructions on this Visual Studio Code webpage .我正在使用 Ubuntu 20.04 并按照此 Visual Studio Code网页上的说明进行操作。 Not sure what caused the problem in the beginning, might be some extension packages related to SSH.一开始不知道是什么原因导致的问题,可能是SSH相关的一些扩展包。

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

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