Last modified: September 07 2020.
Contact: hpchelp [at] iitd.ac.in

PYTHON3

Available Modules:

Module Name:

apps/anaconda/3
Description: Having most the packages used by iitd hpc users ,already installed , check with conda list command , not recommended for conda env creation.

Module Name:

apps/anaconda/3EnvCreation
Description>: Dedicated for creation of conda environment with packages & their versions required by user as per their requirement., also having basic python packages.
Module Name :
compiler/intel/2019u5/intelpython3
Description> : Intel distribution of python ,recommended for installation of packages from source code(having its own advantages).

How to install python packages

Load Python Compiler
module load compiler/intel/2019u5/intelpython3

There are two ways to install python package choose any one. NOTE: Enable internet connectivity before installing python package with pip or for downloading source code , follow steps http://supercomputing.iitd.ac.in/?FAQ#internet


  • Using pip
  • export INST_DIR=/directory/to/install/package
    e.g  export INST_DIR=/home/cc/vfaculty/skapil.vfaculty/pythonpackages/python3/scipy
    OR
    export INST_DIR=$HOME/pythonpackages/python3/scipy
    NOTE: $HOME store path of users directory ,check with echo $HOME command , in this case it is  /home/cc/vfaculty/skapil.vfaculty
    
    mkdir -p $INST_DIR
    
    pip install package_name --prefix=$INST_DIR
    e.g., pip install scipy --prefix=$HOME/pythonpackages/python3/scipy
    
    ## Set the environment variable PYTHONPATH as or append same into .bashrc
    
    export PYTHONPATH=$INST_DIR/python3.6/site-packages:$PYTHONPATH
    e.g., export PYTHONPATH=$HOME/pythonpackages/python3/scipy/python3.6/site-packages:$PYTHONPATH
    
    or
    
    pip install package_name --user
    ## This will install the python packages to hidden folder .local  in your home directory.
    export PYTHONPATH=$HOME/.local/lib/python3.6/site-packages:$PYTHONPATH  
    e.g., pip install scipy --user

  • From Source
  • Download source file of package Example : scipy package installation e.g., $ wget https://pypi.python.org/packages/d0/73/76fc6ea21818eed0de8dd38e1e9586725578864169a2b31acdeffb9131c8/scipy-1.0.0.tar.gz

    export INST_DIR=$HOME/pythonpackages/python3/scipy
    mkdir -p $INST_DIR
    tar xzf scipy-1.0.0.tar.gz
    cd scipy-1.0.0
    export PYTHONPATH=$INST_DIR/python3.6/site-packages:$PYTHONPATH
    python setup.py install --prefix=$INST_DIR
    

    To use the installed packages , please set PYTHONPATH variable correctly for each package everytime for packages or add the same in .bashrc file present in your home folder before using it.

    e.g.,
    export PYTHONPATH=/home/cc/vfaculty/skapil.vfaculty/pythonpackages/python3/scipy/python3.6/site-packages:$PYTHONPATH
    e.g.,
    export PYTHONPATH=/home/cc/vfaculty/skapil.vfaculty/pythonpackages/python3/numpy/python3.6/site-packages:$PYTHONPATH