If you have not installed Python on your machine first you need to download and install Python from https://www.python.org/downloads/.
After installing python on your machine, we need to setup virtual environment where you can work on your python projects separately.
A Python virtual environment is an isolated space where you can work on your Python projects, separately from your system-installed Python. it allows you to create your own libraries and dependencies without affecting the system Python. You can also specify a particular version of Python to use. Use can use virtualenv to create a virtual environment in Python. to create a virtual environment, you need to run a command with the location of the virtual environment folder.
- Open command prompt in windows
- Move to your desired directory and folder
- Type: py -m venv <virtual environment name> (Now your virtual environment is created)
- <virtual environment name>\Scripts\activate.bat (Your virtual environment is activate now)
- To deactivate virtual environment simply type deactivate.