简体   繁体   English

python `deactivate` 命令无法退出 virtualenv

[英]python `deactivate` command can't exit virtualenv

I'm on macOS Catalina [10.15].我在 macOS Catalina [10.15] 上。 Here is what I get when try to deactivate:这是我尝试停用时得到的结果:

(django-learning) ~/git/stats-k8s/k8s-monitor (master) $ deactivate
DeprecationWarning: 'source deactivate' is deprecated. Use 'conda deactivate'.
(django-learning) ~/git/stats-k8s/k8s-monitor (master) $
(django-learning) ~/git/stats-k8s/k8s-monitor (master) $
(django-learning) ~/git/stats-k8s/k8s-monitor (master) $
(django-learning) ~/git/stats-k8s/k8s-monitor (master) $ conda deactivate

CommandNotFoundError: Your shell has not been properly configured to use 'conda deactivate'.
To initialize your shell, run
...    
IMPORTANT: You may need to close and restart your shell after running 'conda init'.
(django-learning) ~/git/stats-k8s/k8s-monitor (master) $

I already looked at question: How to leave/exit/deactivate a Python virtualenv but did not help.我已经看过问题: How to leave/exit/deactivate a Python virtualenv但没有帮助。

I suspect that conda is is interfering with virtualenv on your setup.我怀疑 conda 正在干扰您的设置中的 virtualenv。 Did you install conda in the virtualenv?您是否在 virtualenv 中安装了 conda?

Note that you can also safely close your terminal window and open a new one without using deactivate .请注意,您也可以安全地关闭终端 window 并打开一个新终端,而无需使用deactivate

You might also try activating a different virtual environment.您也可以尝试激活不同的虚拟环境。 You can do this without deactivating first.您可以在不先停用的情况下执行此操作。 Then you may be able to deactivate from the other environment.然后,您可以从其他环境中停用。

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

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