Frequently Asked Question
1- Setting Up and Using an Anaconda Environment
Follow these steps to create and manage your Anaconda environment, install necessary packages, and run your Python scripts.
1.1 Step 1: Load the Anaconda Module
Use the following commands to load the Anaconda module:
bash module use /app/utils/modules module load anaconda3-2024.02
1.2 Step 2: Create Your Anaconda Environment (First Time Only)
To create your own environment, run:
bash conda create -n my_env python
Replace my_env
with your desired environment name.
1.3 Step 3: Activate Your Environment
Activate the environment to start working within it:
bash source activate my_env
1.4 Step 4: Install Required Packages
Install any Python packages you need. For example, to install Pandas:
bash conda install pandas
Replace pandas
with your desired package name.
Note:
- All these steps should be performed on the login nodes, as they are the only nodes with internet access.
- Adjust the environment name and package list to match your specific requirements.
By following these guidelines, you can effectively leverage Anaconda to manage your Python environments and dependencies, streamlining your scientific computing tasks.
2-Run my python code using PBS
please refer to the documentation here [ 4.3 PBS Example Using GPUs (A100) ]
PS: If you need TensorFlow or PyTorch, instead of creating your own environment, it is recommended to clone the pre-installed versions available on Aziz_HPC using the following steps.
2.1 Step 1:list the available environment
bash conda env list
2.2 Step 2:clone the desired environment use the following command
bash conda create --name AnyName --clone NameOfWantedEnv
After cloning, you can activate the environment using the same name you selected during the cloning. Once activated, you may install additional packages if needed.
3- Pytorch and TensorFlow sample
To view the samples, use the commands below.
For Pytoch sample
bash cd /app/samples/a100-pt-sample/
For TensorFlow Sample
bash cd /app/samples/a100-tf-sample/
4- Conda Basic Commands
Please note that the following command will work only when the environment is active.
4.1 1. Verify Conda Installation and Version
bash conda info
Use this command to check if Conda is installed and to display its version and system details.
4.2 2. Install a Package
bash conda install -c CHANNEL PACKAGENAME
Install a package included in Anaconda. Replace CHANNEL
with the appropriate repository (e.g., defaults
or conda-forge
) and specify the PACKAGENAME
.
4.3 3. Get Command Line Help
bash COMMANDNAME --help
Displays detailed usage instructions and available options for a specific Conda command.
4.4 4. List All Installed Packages
bash conda list
Lists all packages installed in the active Conda environment, along with their versions.
For more commands, please click on Conda sheet cheat here