---
# System prepended metadata

title: 9/8/2023

---

# Setting up Conda in linux
1) Download Conda (Anaconda or Miniconda)
```
Go to: https://docs.conda.io/projects/conda/en/latest/user-guide/install/linux.html
Select Linux
Copy this address: https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
In terminal: $wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
```
2) Check Conda was successfully installed
```
$ls

Miniconda3-latest-Linux-x86_64.sh
```
3) Run and Extract the `.sh` File
```
$sh Miniconda3-latest-Linux-x86_64.sh
```
4) File will ask for license, agree to all terms
5) After license agreement and other necessary agreements, close the terminal
6) Reopen the terminal. It should looking something like this:
```
(base) joelshin @ login-0 ~
```
# Conda Basics
1) To create conda environment
```
$conda create -n (Name of your Environment) python=X (X = Choose python verion)
```
2) To see conda environments
```
$conda env list

# conda environments:
#
base                  *  /data/gpfs/home/joelshin/miniconda3
jcvi                     /data/gpfs/home/joelshin/miniconda3/envs/jcvi
```
3) To activate an environment
```
$conda activate jcvi 

(jcvi) joelshin @ login-0 ~
```
4) To deactivate an environment
```
$conda deactivate

(base) joelshin @ login-0 ~
```
# Locate Scratch folder
1) Check which directory you are in
```
$pwd

/data/gpfs/home/joelshin
```
2) Locate Scratch folder
```
$cd ../../

(base) joelshin @ login-0 12:08:33 /data/gpfs

$cd assoc/pgl/joel

(base) joelshin @ login-0 12:08:39 /data/gpfs/assoc/pgl/joel
```
# To Link Miniconda to Scratch Folder

1) Link Home to Scratch folder
```
$ln -s /data/gpfs/assoc/pgl/joel ~/scratch

$cd ~/scratch/

(base) joelshin @ login-0 12:57:17 ~/scratch

cd ../ #Return to main/home Directory

(base) joelshin @ login-0 12:57:32 ~

$ll

lrwxrwxrwx  1 joelshin p-joelshin 25 Sep 8 12:57 
scratch -> /data/gpfs/assoc/pgl/joel
```
2) If Miniconda or Conda is installed first 
```
$rm -rf miniconda3/

vi ~/.bashrc
(In this part, It gives you a wall of text. Remove all the function that is related to 
Conda. After that, hit Esc then Shift+; and finaly write wq and Enter)
```
3) Redownload Conda and add it to ~/scratch
```
$bash ./Miniconda3-latest-Linux-x86_64.sh

This is crucial: When the prompt asks the user: 
'Miniconda3 will now be installed into this location:
/data/gpfs/home/joelshin/minicond3' 
and will ask 
[/data/gpfs/home/joelshin/miniconda3]. After the '>>>', add the path:
~/scratch/miniconda3. As usual follow all the agreements.

This is the result:

/data/gpfs/home/joelshin/scratch/miniconda3/
```
