conda - Serbipunk/notes GitHub Wiki

cheat sheet

https://docs.conda.io/projects/conda/en/4.6.0/_downloads/52a95608c49671267e40c689e0bc00ca/conda-cheatsheet.pdf

#
# 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

https://medium.com/python4u/%E7%94%A8conda%E5%BB%BA%E7%AB%8B%E5%8F%8A%E7%AE%A1%E7%90%86python%E8%99%9B%E6%93%AC%E7%92%B0%E5%A2%83-b61fd2a76566

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).