- Trending Categories
- Data Structure
- Operating System
- C Programming
- 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.
- Python Virtual Environment
- How to create a virtual environment in Python?
- Difference between Linux and Windows
- How to set python environment variable PYTHONPATH on Windows?
- Difference Between Linux and Windows Operating System
- How to set python environment variable PYTHONPATH on Linux?
- How to configuring Java Environment on Windows?
- Setting MySQL Environment Variables on Linux
- What are the process states in Windows and Linux?
- How to install JDK in Windows and set up the environment variables?
- What are the fundamental differences between Windows and Linux?
- How to configuring Java Environment on Linux?
- Run Linux Natively on Windows 10
- Vagrant vs Docker for creating an isolated environment
- Creating virtual tables from remote source in SAP HANA