How to create a python virtual environment on Windows with venv.
Step 1: Navigate to your project directory
cd C:\Users\user\Desktop\Ferds Tech Channel\Topics\Python
Step 2: Create a virtual environment named 'my_venv'
python -m venv my_venv
Step 3: Activate the virtual environment
my_venv\Scripts\activate
Step 4: Install example packages (e.g., requests and numpy)
pip install requests numpy
Step 5: Deactivate the virtual environment when done
deactivate
Additional Tips:
Creating requirements.txt:
Use pip freeze requirements.txt to create a file listing all installed packages in the virtual environment.
Recreating the environment:
Use pip install -r requirements.txt to install all packages listed in requirements.txt in a new virtual environment.
Steps to Delete a Python Virtual Environment
1. Deactivate the Virtual Environment (if it's active):
deactivate
2. Delete the Virtual Environment Directory.
#python #cisco #devnet
On this page of the site you can watch the video online Python Tutorial: venv on Windows for beginners // network engineers with a duration of hours minute second in good quality, which was uploaded by the user Ferds Tech Channel 09 June 2024, share the link with friends and acquaintances, this video has already been watched 175 times on youtube and it was liked by 4 viewers. Enjoy your viewing!