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 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

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