Skip to main content

Environment Modules and Virtual Environment

Environment Modules (or modules) are used to manage the user environment for the installed packages. This makes it simple to use different packages or switch between versions of the same package without conflicts.

The commands for environment modules:

  • CODE
    module avail 

    List of application software that is installed on the HPC

  • CODE
    module load packageName

    Loads the specified package with specified version

  • CODE
    module list

    List the uploaded application softwares

  • CODE
    module unload packageName

    Unloads the specified package with specified version

  • CODE
    module purge

    Unload all packages from user environment.

Do not use wget or any other ways to install software. If you do you can have problems about job submitting and it will slow down your remote computer.

You can load necessary module through job scripts or terminal. But, wise thing to do is creating a job script to load modules such as gcc, cuda and adding to .bashrc file or run it every time. You can create different job scripts which includes necessary modules for specific projects.

If you want any other software installed, or a different version, send a request email ​IT@ku.edu.tr.​ Please include a detailed information about the software like web page, version, license etc. Note that if the software requires a licence, the users of the software will need to purchase the licence.

How to create a Virtual Environment?

  • List modules and choose an anaconda version from list.

CODE
module avail
module load anaconda/x.x.x (version you choose)

Now, you will have conda command running since it was added into your PATH.

CODE
conda create -n env_name python=x.x.x anaconda
  • You will have conda virtual environment installed under your home folder
    ( /kuacc/users/username/.conda/ )

    CODE
    /kuacc/users/username/.conda/
  • You can activate/deactivate virtual env by:

CODE
source activate env_name
  • You can install any software under your evironment by “pip install” or “conda install” commands.

CODE
pip install package_name
  • In order to deactivate virtual environment

CODE
source deactivate
  • You need to add

CODE
module load anaconda/x.x.x
source activate env_name

Run your code.

CODE
source deactivate env_name

into your job script.

If you want to remove the virtual environment:

CODE
conda remove -n env_name -all -y

If you get an error like this while pip install in virtual environment:

CODE
PermissionError: [Errno 13] Permission denied: '/kuacc/apps/anaconda/3.6….

This is because the package you want to install tries to write under (/kuacc/apps) which you do not have permission to access. Another reason is trying to remove the default packages that create env.

To fix the problem, you can force the home folder to be used by using the --user statement.

CODE
pip install -r requirements.txt --user

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.