Feb-10-2024, 02:20 PM
Hello everyone,
I am curious to know how you others use virtual environments in their daily Python life....Virtual environments are an important topic. I am a Windows user this is what I think is the correct sequence of steps:
a) Create a regular Windows folder calling it Project01.This folder contains the .py scripts and the virtual environment folder itself Each different project should have its own folder containing related scripts and its dedicated virtual environment.
b) Next we open the Windows terminal (CMD or Powershell), use the folder full path to go to the folder Project01 where the virtual environment folder will be located, type python -m venv ven01 to create a virtual environment called ven01 inside the folder Project01.
c) A the command line, type ven01\Scripts\activate to activate the environment.
What to do from here? Now I have an activated virtual environment....I can open an code IDE at that point...How do I ensure that the code I write (the .py script) is connected to the activated virtual environment?
I know some IDEs (VS code, etc.) have their own terminal/shell so we don't need to use CMD but I would like to know how to proceed from there to better understand the inner workings....
THANK YOU
bytecrunch
I am curious to know how you others use virtual environments in their daily Python life....Virtual environments are an important topic. I am a Windows user this is what I think is the correct sequence of steps:
a) Create a regular Windows folder calling it Project01.This folder contains the .py scripts and the virtual environment folder itself Each different project should have its own folder containing related scripts and its dedicated virtual environment.
b) Next we open the Windows terminal (CMD or Powershell), use the folder full path to go to the folder Project01 where the virtual environment folder will be located, type python -m venv ven01 to create a virtual environment called ven01 inside the folder Project01.
c) A the command line, type ven01\Scripts\activate to activate the environment.
What to do from here? Now I have an activated virtual environment....I can open an code IDE at that point...How do I ensure that the code I write (the .py script) is connected to the activated virtual environment?
I know some IDEs (VS code, etc.) have their own terminal/shell so we don't need to use CMD but I would like to know how to proceed from there to better understand the inner workings....
THANK YOU
bytecrunch