Skip to main content

Conda

Another example of conda environment setup.

Login on the submit node

Login on the cluster submition node, check the page How to Access for more information:

$ ssh -l <username> hpc7.ncg.ingrid.pt
[username@hpc7 ~]$ _
Prepare a conda virtual environment

The default python version for CentOS 7.x is 2.7.5 which is not suitable for many applications. So, we will create a python virtual environment:

[username@hpc7 ~]$ conda create -n myconda python=3.6
[username@hpc7 ~]$ conda activate myconda

On the first command, where we create the conda virtual environment, you can include a list of applications to include on you environmnet, for example:

[username@hpc7 ~]$ conda create -n myconda python=3.6 ipython-notebook numpy=1.6
Manage the conda virtual environment

It is possible to include additional packages to you conda environment, for examplo:

[username@hpc7 ~]$ conda activate myconda
[username@hpc7 ~]$ conda install numpy

You can update your software bandle on the conda virtual environment with command:

[username@hpc7 ~]$ conda update [scipy ...]

or remove a specific application:

[username@hpc7 ~]$ conda uninstall tensorflow-gpu

Check the help for more information:

[username@hpc7 ~]$ conda help
Manage the conda packages list with pip

It is possible to complemment the conda virtual environment packages list with pip. For example:

[username@hpc7 ~]$ conda activate myconda
[username@hpc7 ~]$ pip install --upgrade pip
[username@hpc7 ~]$ pip install --upgrade setuptools
[username@hpc7 ~]$ pip install tensorflow-gpu
[username@hpc7 ~]$ pip install keras
Manage packages versions

If the applications available on conda virtual environment do not match your version requirements you may need to use packages from pip repostory; check the availability of conda search and pip search command line interfaces.

As an example we have the tensorflow-gpu package, when used with keras the conda repository downgrade *tensorflow-gpu to version 1.15 and you most like will prefer the 2.0 version. The pip repository have the right combination for tensorflow-gpu and keras packages.

We advise the user to install a packages from only one repository in order to guarantee perfect behaviour.

Some References