- Trending Categories
- Data Structure
- Operating System
- MS Excel
- C Programming
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Creating Python Virtual Environment in Windows and Linux
Virtual Environment is used to manage our Python projects more efficiently. Every project has a dedicated environment for better results and future updates. For example, we have a project which uses Django2.1 and another one that uses Django2.2. Now, in these types of cases, we can make use of virtual environments to both projects individually without any problem. In this tutorial, we are going to see how to work with the virtual environment. We need to install virtualenv. Run the following command to see whether virtualenv is installed on your computer or not.
If you run the above command, you will see the following(maybe different version) output.
If you didn't see the version of the virtualenv then, it's not installed on your computer. Run the following command to install it on your PC.
pip install virtualenv
Now, we are ready to create our virtual environments. Follow the below steps one by one to create a virtual environment.
Command to initialize the project with virtualenv.
If you run the above command, you will get a folder with the name you mentioned.
Command to activate the virtualenv.
Now, you are in a virtual environment. Python defaults install the latest version of it in the virtualenv.
Command to deactivate.
If you have any doubts regarding the tutorial, mention them in the comment section.
- Related Articles
- Python Virtual Environment
- How to create a virtual environment in Python?
- How to set python environment variable PYTHONPATH on Windows?
- Difference between Linux and Windows
- Merits and Demerits of VMware vSphere hosted Virtual Environment
- Managing Environment Variables in Linux
- Locale Environment Variables in Linux
- How to set Python environment variable PYTHONPATH on Linux?
- How to configuring Java Environment on Windows?
- How to install JDK in Windows and set up the environment variables?
- Difference Between Linux and Windows Operating System
- Best Syslog Servers for Linux and Windows
- What are the process states in Windows and Linux?
- Creating virtual tables from remote source in SAP HANA
- Creating a Temporary File in Linux