---
title: "Python Basics Ubuntu"
url: "https://help.dectris.cloud/en/article/python-basics-ubuntu"
language: "en"
last_updated: "2025-10-08T22:07:44.652Z"
---

# 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:

```plaintext
/opt/conda/
```

While the Conda `basics` environment is installed in:

```plaintext
/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

```plaintext
 conda activate basics
```

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

![](https://cdn-assets.productfruits.com/4c3b4b0c-e702-4583-9368-748e32c5fb9b)

### **Configuring job templates**

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

```plaintext
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`):

```plaintext
#!/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](https://help.dectris.cloud/en/article/simple-python-example): A simple example job template that shows how to upload a python script and execute it within the Conda `basics` environment.
-   [Double Moons - Machine Learning Example](https://help.dectris.cloud/en/article/double-moons-machine-learning-example): Machine learning demo that trains an SVM on the two-moons dataset and lets you classify four user-chosen points.

## **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**

-   **Python 3.10 documentation**: [https://docs.python.org/3.10/](https://docs.python.org/3.10/)
-   **Numpy**: Harris, Charles R., et al. "Array programming with NumPy." *nature* 585.7825 (2020): 357-362. [https://doi.org/10.1038/s41586-020-2649-2](https://doi.org/10.1038/s41586-020-2649-2)
-   **SciPy**: Virtanen, Pauli, et al. "SciPy 1.0: fundamental algorithms for scientific computing in Python." *Nature methods* 17.3 (2020): 261-272. [https://doi.org/10.1038/s41592-019-0686-2](https://doi.org/10.1038/s41592-019-0686-2)
-   **Pandas**: McKinney, Wes. "Data structures for statistical computing in Python." *scipy* 445.1 (2010): 51-56. [https://doi.org/10.25080/Majora-92bf1922-00a](https://doi.org/10.25080/Majora-92bf1922-00a)
-   **Matplotlib**: Hunter, John D. "Matplotlib: A 2D graphics environment." *Computing in science & engineering* 9.03 (2007): 90-95. [https://doi.org/10.1109/MCSE.2007.55](http://doi.org/10.1109/MCSE.2007.55)
-   **Jupyter**: Kluyver, Thomas, et al. "Jupyter Notebooks–a publishing format for reproducible computational workflows." *Positioning and power in academic publishing: Players, agents and agendas*. IOS press, 2016. 87-90. [https://doi.org/](https://doi.org/10.3233/978-1-61499-649-1-87)  
    [10.3233/978-1-61499-649-1-87](https://doi.org/10.3233/978-1-61499-649-1-87)
-   **Scikit-learn**: Pedregosa, Fabian, et al. "Scikit-learn: Machine learning in Python." *the Journal of machine Learning research* 12 (2011): 2825-2830. 
-   **Scikit-image**: Van der Walt, Stefan, et al. "scikit-image: image processing in Python." *PeerJ* 2 (2014): e453. [https://doi.org/10.7717/peerj.453](https://doi.org/10.7717/peerj.453)
-   **Seaborn**: Waskom, Michael L. "Seaborn: statistical data visualization." *Journal of open source software* 6.60 (2021): 3021. [https://doi.org/10.21105/joss.03021](https://doi.org/10.21105/joss.03021)
-   **Plotly**: [https://plotly.com/python](https://plotly.com/python)
-   **Statsmodels**: Seabold, Skipper, and Josef Perktold. "Statsmodels: econometric and statistical modeling with python." *SciPy* 7.1 (2010): 92-96. [https://doi.org/10.25080/Majora-92bf1922-011](https://doi.org/10.25080/Majora-92bf1922-011)
-   **SymPy**: Meurer, Aaron, et al. "SymPy: symbolic computing in Python." *PeerJ Computer Science* 3 (2017): e103. [https://doi.org/10.7717/peerj-cs.103](https://doi.org/10.7717/peerj-cs.103)
-   **Numba**: Lam, Siu Kwan, Antoine Pitrou, and Stanley Seibert. "Numba: A llvm-based python jit compiler." *Proceedings of the Second Workshop on the LLVM Compiler Infrastructure in HPC*. 2015. [https://doi.org/10.1145/2833157.2833162](https://doi.org/10.1145/2833157.2833162)
-   **Joblib**: [https://joblib.readthedocs.io/en/stable/](https://joblib.readthedocs.io/en/stable/)
-   **Pillow**: [https://pypi.org/project/pillow/](https://pypi.org/project/pillow/)
-   **h5py**: [https://www.h5py.org/](https://www.h5py.org/)
-   **netCDF4**: [https://unidata.github.io/netcdf4-python/](https://unidata.github.io/netcdf4-python/)
-   **OpenPyXL**: [https://openpyxl.readthedocs.io/en/stable/](https://openpyxl.readthedocs.io/en/stable/) 
-   **xlrd**: [https://xlrd.readthedocs.io/en/latest/](https://xlrd.readthedocs.io/en/latest/)
-   **PyYAML**: [https://pyyaml.org/](https://pyyaml.org/)
