Python Basics Ubuntu

Introduction

The Python Basics Ubuntu environment provides a lightweight Ubuntu-based setup for running and testing Python scripts. It is intended as a general-purpose environment for basic Python usage, quick prototyping, and learning.

This environment is the system environment equivalent of the Python Basics environment, which can be used to start Jupyter Notebook sessions. 

Environment configuration

Installation directories

Miniconda (version 25.7.0) has been installed in:

/opt/conda/

While the Conda basics environment is installed in:

/opt/conda/envs/basics/

containing:

  • Core language
    • python=3.10.18
  • Scientific libraries
    • numpy
    • scipy
    • pandas
  • Visualization libraries
    • matplotlib
    • jupyterlab
    • ipython
    • seaborn
    • plotly
  • Machine learning, statistics, and scientific computing
    • scikit-learn
    • scikit-image
    • statsmodels
    • sympy
    • numba
    • joblib
  • Image and file format support
    • pillow
    • h5py
    • openpyxl
    • xlrd
    • pyyaml

Usage example

To use the Conda basics environment, open a terminal and run

 conda activate basics

Following this, python (version 3.10.18) with the installed packages can be called or run using python or python3:

Configuring job templates

When creating job templates with this environment, the Conda basics environment can be activated via:

source /opt/conda/etc/profile.d/conda.sh
conda activate basics

Following the activation of the environment, you can run your own uploaded python script within the environment. A minimal example job script would be (assuming an uploaded hello_world.py):

#!/bin/bash
set -euo pipefail

source /opt/conda/etc/profile.d/conda.sh
conda activate basics

python3 $JOB_TEMPLATE_DIR/hello_world.py 

Public job templates

Example of job template(s) that have been created for this environment and made public:

  • Simple python example: A simple example job template that shows how to upload a python script and execute it within the Conda basics environment.

Version history

Version 0

  • Initial installation of Miniconda (version 25.7.0) and listed packages

Version 1

  • Build error (not useable)

Version 2

  • Rebuild of Version 0 to support multiple regions.

References

Was this article helpful?