To create a Python virtual environment using the venv module, you can use the following steps:
-
Open a terminal window and navigate to the directory where you want to create the virtual environment.
-
Run the following command to create the virtual environment:
python3 -m venv oculight_env- Activate the virtual environment using the following command:
source oculight_env/bin/activate- You can now install packages and run Python scripts in the virtual environment. To install packages in a new environment, you can use the following command:
pip install -r requirements.txtThis will install all the packages listed in the requirements.txt file in the new environment.
- To deactivate the virtual environment, use the
deactivatecommand.
deactivate