Env - anaconda/pip/poetry
Pip
Init an env
Export to requirements.txt
Install from requirements.txt
Anaconda
Create env in current folder
conda create --prefix ./envs
## Or
conda create -p ./envs
## create with a specific python version
conda create -p .venv python=3.8
Activate env
Issue: Env name is too long
Cancel “auto activate env”
List env set
Share Environment (output to environment.yml)
Install 3rd party package in Anaconda
- Ensure there is pip installed INSIDE your current anaconda env by running
conda list | grep pip
- Run pip like usual to install the package you want
Below method is deprecated
- ~Run conda create -n venv_name and conda activate venv_name, where venv_name is the name of your virtual environment.~
- ~Run conda install pip. This will install pip to your venv directory.~
- ~Find your anaconda directory, and find the actual venv folder. It should be somewhere like
/anaconda/envs/venv_name/
~ - ~Install new packages by doing /anaconda/envs/venv_name/bin/pip install package_name.~