How to deactivate a Python Virtual Environment -virtualenv


Let's say you create a virtual environment for your Python project as below,

% cd ~/Desktop 
% mkdir mypyproj
% cd mypyproj 
% virtualenv mypyproj_venv

created virtual environment CPython3.11.4.final.0-64 in 258ms

Now to activate this virtual environment you run the below command,

Windows:
 mypyproj_venv\Scripts\activate
Linux/macOS
source mypyproj_venv/bin/activate

Once the virtual environment is active you will see your prompt something like the below,

(mypyproj_venv)  Code2care@Mac % 

Now to exit or deactivate the virtualenv simply type deactivate on the prompt.

deactivate

And you should be out of it!

How to deactivate Python Virtual Environment Example
-

Facing issues? Have Questions? Post them here! I am happy to answer!


Author Info:

Rakesh (He/Him) is a seasoned developer with over 10 years of experience in web and app development, and a deep knowledge of operating systems. Author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail: rakesh@code2care.org

Copyright © Code2care 2023 | Privacy Policy | About Us | Contact Us | Sitemap