If you want to use Python on the SCC, the recommended way is to use separate environments for each of your projects. You can use any tool you like and install it in your home folder. In my (Thomas) personal opinion, using pixi is the most convenient way to do so. So, this is the way it is shown here.
Installation
To install pixi, all you need to do is open a terminal and enter:
curl -fsSL https://pixi.sh/install.sh | bash
cp /etc/skel/.bash_profile ~/
Accept all default options. When it is done, you need to restart your terminal.
Now you should get some output when you enter pixi
in the terminal.
Prepare an environment
Create some folder where your project is going to live, enter it and issue pixi init
:
mkdir my_project
cd my_project
pixi init
This creates a pixi.toml
file which contains all the configuration. One important
thing to do is to add the following lines to the pixi.toml
file:
[system-requirements]
linux = "4.18"
Now you can use pixi add
to install the packages you need. For instance, to install
MNE Python and matplotlib, you would do:
pixi add mne matplotlib
Using your environment
To use your environment, you need to enter it. This is done by issuing:
pixi shell
If you use Visual Studio Code, the environment is not automatically discovered.
You need to open some python file and then press Ctrl+Shift+P
and enter Python: Select Interpreter
.
Then, choose .pixi/envs/default/bin/python
as the interpreter.