python
# 进入项目目录
cd /path/to/project
# 激活环境
source ./python3.10/bin/activate
# 验证环境
(python3.10) user@host:\~$ which python
/home/user/project/python3.10/bin/python
# 退出环境
(python3.10) user@host:\~$ deactivate
user@host:\~$
以上是大模型给我的模拟效果。但实际我没有退出。
暴力退出,直接输入exit() ,不仅会退出激活的python环境,还会关掉整个mobatek的窗口,随即想其他办法。查了一圈找到了。
若,输入 deactivate 不能退出,可以试试
conda deactivate
还不行的话
source deactivate
注:会提示该用法已经"deprecated"不赞成;祈免;贬低。但,就是好使,说明服务器上老版本。