深度阅读

How to leave/exit/deactivate a Python virtualenv

作者
作者
2023年08月22日
更新时间
8.63 分钟
阅读时间
0
阅读量

To leave or deactivate a Python virtualenv, you can use the deactivate command. This will return you to the system’s default Python environment.

Depending on your operating system and how you set up the virtual environment, the command to deactivate may vary slightly. Here are some examples:

  • On Unix or Linux, simply type deactivate:
deactivate
  • On Windows, use the Scripts folder to run the deactivate.bat script:
Scripts\deactivate.bat
  • If you are using conda, you will need to use the conda deactivate command:
conda deactivate

It’s important to note that once you deactivate a virtualenv, any packages you installed while in that environment will no longer be available. Therefore, if you need to use that environment again in the future, you will need to activate it again and reinstall the packages.

博客作者

热爱技术,乐于分享,持续学习。专注于Web开发、系统架构设计和人工智能领域。