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 in 258ms

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

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.


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) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail:

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