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
En esta página del sitio puede ver el video en línea Python Tutorial: venv on Windows for beginners // network engineers de Duración hora minuto segunda en buena calidad , que subió el usuario Ferds Tech Channel 09 junio 2024, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 175 veces y le gustó 4 a los espectadores. Disfruta viendo!