Conda and pip
Conda usage and switching to the internal mirror—Shanhe Mirror
The cluster's default Python environment is version 2.7, which lacks relevant dependency packages. If you require specific Python dependencies or a newer Python version, it is recommended to create your own Python environment and install the necessary packages (note that only a 3.9 environment is available via modules).
1. Switch mirrors by executing the following command
cat > ~/.condarc << "EOF"
channels:
- defaults
show_channel_urls: true
default_channels:
- https://mirrors.shanhe.com/anaconda/pkgs/main
- https://mirrors.shanhe.com/anaconda/pkgs/r
- https://mirrors.shanhe.com/anaconda/pkgs/msys2
custom_channels:
bioconda: https://mirrors.shanhe.com/anaconda/cloud
conda-forge: https://mirrors.shanhe.com/anaconda/cloud
ssl_verify: false
EOF
Note:
After installing the latest version of conda post-2024, a .condarc file is generated in the main conda directory. Please delete the default .condarc file in the conda main directory or add the above channels to the .condarc file in the main directory to override the default channels, otherwise conflicts will cause errors.
2. Create a Conda environment
conda create -n python39 python=3.9
# -n: Set the name of the new environment
# python=3.9 specifies the Python version for the new environment; this parameter is optional
# You can also use the -y flag to skip the installation confirmation prompt.
3. Using the Conda environment
# Activate and load the Python environment
conda activate python39
# conda installation command
conda install gatk
# Install a specific version
# conda install <package_name>=<version_number>
conda install gatk=3.7
# conda search for required packages
conda search gatk
# Update a specific package
conda update gatk
# Uninstall a specific package
conda remove gatk
4. Initialize the Conda environment for the account
# Configure conda environment creation and automatic account loading
# Add the following command to the ~/.bashrc file
conda activate python39
pip usage and switching to the internal mirror—Shanhe Mirror
1. Using the internal mirror with pip
The following examples demonstrate two methods for installing the numpy library using pip
# Method 1
mkdir ~/.pip
cd ~/.pip
vim pip.conf
[global]
index-url=https://mirrors.shanhe.com/simple
trusted-host = mirrors.shanhe.com
:wq
pip install nump
## Method 2
pip install nump -i https://mirrors.shanhe.com/simple