# Python 退出当前的虚拟环境

**URL:** <https://www.isharkfly.com/t/python/16312>\
**Category:** 程序语言\
**Tags:** python\
**Created:** [September 18, 2024, 7:47pm UTC](https://www.isharkfly.com/t/python/16312 "2024-09-18T19:47:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![honeymoose](https://www.isharkfly.com/user_avatar/www.isharkfly.com/honeymoose/32/20796_2.png) [@honeymoose](https://www.isharkfly.com/u/honeymoose)\
**Post date:** [September 18, 2024, 7:47pm UTC](https://www.isharkfly.com/t/python/16312/1 "2024-09-18T19:47:03Z")

</div>

退出当前的虚拟环境的命令比较简单，直接运行

`deactivate`

就可以了。

 ![2024-09-18_15-45-55](https://cdn.isharkfly.com/com-isharkfly-www/discourse-uploads/original/2X/7/77fc303079c45613b5ec3ef00555573b6b4f7ea8.png)

在退出虚拟环境后，在命令行的前端就看不到虚拟环境的名称了。

在这种情况下，表示的虚拟环境被退出。
