This is a short tutorial on how to set up a Conda environment and manage it on the HUJI computer cluster.
These four commands download the latest 64-bit version of the Linux installer of miniconda in the user repository, rename it to a shorter file name, silently install, and then delete the installer. Ideally it's better to replace to path with one in a lab folder since personal storage is very limited.
1mkdir -p ~/miniconda3
2wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda3/miniconda.sh
3bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
4rm ~/miniconda3/miniconda.sh
Finally, run the following which updates .zsrch and adds conda to PATH:
1~/miniconda3/bin/conda init zsh
And restart the shell (exec zsh).
For full documentation see https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html.
Create an environment:
1conda create -n <env_name> python=<python_version>
2
3OR
4
5# for custom path
6conda create -p <path/to/envname> python=<python_version>
7conda config --append envs_dirs <path/to>
8
Delete an environment:
1conda remove -n <env_name> --all
List environments:
1conda info --envs
Activate an environment (this is a prerequisite to all following commands):
1conda activate <env_name>
Deactivate an environment:
1conda deactivate
List packages in environment:
1conda list
Install package:
1conda install <package_name>
2
3OR
4
5pip install <package_name>
Running python:
1python <file_path.py>
Share an environment: 1. Export:
1conda env export > environment.yml
1conda env create -f environment.yml
conda install ipykernel before creating the kernel. Other instruction for setting up IDE remote development are here. (In my experience VS code is easier to set up than PyCharm).