bluemachine_docs

Python Environment

Learn how Python is set up in your sandboxes, how to install custom libraries, and how to manage dependencies.

BlueMachine sandboxes are built on top of high-performance Google Cloud Platform hypervisors running a modern Linux kernel. This provides native speed and complete runtime isolated flexibility.

Ubuntu 24.04 LTS Base Image

All leased sandboxes spin up using an Ubuntu 24.04 LTS (Noble Numbat) template. Because Ubuntu 24.04 LTS includes Python 3 pre-installed, Python 3.12 is available out-of-the-box on every sandbox.

Since Ubuntu comes with Python pre-installed, you can run python commands or execution files immediately. The local workspace files are mirrored in the VM under /home/bluemachine/workspace.

Run a python script instantly
machine run "python3 train.py"

To install external Python packages, you can execute package managers like pip directly during the lease session. Because the client shell executes with root-level sudo privileges, you can install any libraries or apt dependencies you require:

Install packages and run script
machine run "pip install numpy scikit-learn && python3 train.py"
Session Ephemerality

When using 'machine run', the sandboxed VM is automatically destroyed as soon as the command exits. This means any packages installed during that run are discarded. If you need packages and files to persist across multiple executions, use persistent Stations.

With Developer Stations, you can keep a VM running continuously. Run commands interactively or log into the shell, and all files, virtual environments, and python packages will remain safe and persistent:

Persistent Station operations
# Create a persistent station
machine station create --class flex-medium
# Run commands inside the persistent environment
machine station run "pip install numpy"
machine station run "python3 train.py"
STATUS // BETADOCS.BLUEMACHINE