A complete step-by-step tutorial from start to finish

Image for post

Introduction:

A virtual environment allows your projects to operate independently from the main Python environment. It provides an effective way to prevent version conflicts between dependencies of different projects.

It only takes one command to create the virtual environment.

But, there’re multiple steps that must be completed beforehand.

This article covers all of the steps needed from start to finish.

It’s written for Windows, but it’s also available for MacOS.


Install Virtualenv :

Virtualenv is the tool we’re going to use to create the virtual environment.

In this section, we’ll use pip to install virtualenv:

  1. Open Command Prompt
  2. Copy the command from below these instructions
  3. Paste the command into Command Prompt
  4. Press “Enter”
python -m pip install virtualenv

Get the Existing Python Version:

We need to know the Python version we have to rename its executable file.

In this section, we’ll use Command Prompt to get the Python version:

  1. Open Command Prompt
  2. Copy the command from below these instructions
  3. Paste the command into Command Prompt
  4. Press “Enter”
python --version

#virtual-environment #command-line #python #windows-10 #libraries

How to Setup a Virtual Environment With Different Python Versions:
1.45 GEEK