Jotting one man's journey through software development, programming, and technology
◀️ Home
A virtual environment is an isolated workspace for a Python (or Conda) project where you can install specific packages and dependencies without affecting other projects or the global environment. In short: they let each project have its own clean, independent setup.
Purpose:
Tools:
conda create --name myenv
conda create --name myenv python=3.9
conda env remove -n env_name
conda remove --name <env_name> --all
conda env list
conda info --envs
conda list -n myenv
conda init # necessary to run it first if it's the first time
conda activate myenv
conda deactivate
Run the following command to locate the base directory where Conda is installed:
conda info | grep -i 'base environment’
Once you have the base directory, append /etc/profile.d/conda.sh
to it.
pip install sheet-logger
pip install sheet-logger==1.0.7.1
pip show sheet-logger # verify the installation
requirements.txt
pip install -r requirements.txt
requirements.txt
conda create --name myenv python=3.11
conda activate myenv
pip install -r requirements.txt
Run the following command to automatically list all the installed packages (and their versions) into a requirements.txt
file:
pip freeze > requirements.txt
This will create a requirements.txt
file in your current directory with all the installed packages and their respective versions.