Skip to content

Instantly share code, notes, and snippets.

@sean-smith
Last active January 30, 2024 17:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sean-smith/28aecb8bc77077c2b587a6b49a9b51f2 to your computer and use it in GitHub Desktop.
Save sean-smith/28aecb8bc77077c2b587a6b49a9b51f2 to your computer and use it in GitHub Desktop.
Python 3.10 on Hyperpods

Ubuntu 20.04

  1. Create a script install-python.sh with the following content:
#!/bin/bash

sudo apt update 
sudo apt upgrade -y
sudo apt install software-properties-common -y 
sudo add-apt-repository ppa:deadsnakes/ppa

sudo apt install -y python3.10

# set as default version
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1
  1. Next run this locally on the Head Node to change the default version:
$ bash install-python.sh
$ python3 --version
Python 3.10.13
  1. Run with srun to customize all the compute nodes, note that -N 8 should be the number of instances in your cluster. This takes about 20 minutes. Each node is done in parallel.
srun -N 8 bash install-python.sh
  1. Finally verify the version was correctly set:
srun -N 8 python3 --version
  1. This should print out python3.10 for all compute nodes:
Python 3.10.13
Python 3.10.13
Python 3.10.13
Python 3.10.13
Python 3.10.13
Python 3.10.13
Python 3.10.13
Python 3.10.13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment