conda - Serbipunk/notes GitHub Wiki
cheat sheet
#
# To activate this environment, use
#
# $ conda activate unsup3d
#
# To deactivate an active environment, use
#
# $ conda deactivate
create env
conda create --name py35 python=3.5
copy env
conda rename -n old_name new_name
https://stackoverflow.com/a/42231765
list all env
conda env list
https://www.w3schools.blog/list-conda-environments
environment.yaml
http://pre.tir.tw/008/blog/output/conda_yml.html
version
conda -V
example
clone environment & add activatable name
Deactivate the env and stop anything using it (in VS Code’s terminal or a system terminal):
conda deactivate
Clone the existing env into the new location (this is the safe way; “moving” the folder can break paths inside packages):
conda create --prefix /home/milesb/conda_envs/trellis-base --clone /home/milesb/git/TRELLIS.2/conda-env
Test the new env works:
conda activate /home/milesb/conda_envs/trellis-base
python -c "import sys; print(sys.executable)"
(Optional) Make it activatable by name trellis-base (so you can do conda activate trellis-base), by adding that directory to Conda’s env search path:
conda config --add envs_dirs /home/milesb/conda_envs
Open a new shell (or restart the terminal), then:
conda activate trellis-base
conda env list should then show it as trellis-base (not just a full path).
Remove the old env after you’re sure everything works:
conda env remove --prefix /home/milesb/git/TRELLIS.2/conda-env
Update VS Code to use the new interpreter (so your workspace uses the moved env).
Use the Python: Select Interpreter command to pick the interpreter from /home/milesb/conda_envs/trellis-base/bin/python (or select trellis-base if it appears by name).