Python Commands
Execute Python code or files on Lyceum Cloud with configurable machine types and dependencies.
Commands
| Command | Description |
|---|
lyceum python run | Execute Python code or file on Lyceum Cloud |
lyceum python config init | Initialize workspace configuration |
lyceum python config show | Show current workspace configuration |
lyceum python config refresh | Refresh workspace configuration |
lyceum python run
Execute Python code or a Python file on Lyceum Cloud.
lyceum python run <code_or_file>
Arguments
| Argument | Description |
|---|
code_or_file | (required) Python code string or path to a Python file |
Options
| Option | Description |
|---|
--machine, -m | Machine type (cpu, gpu, gpu.a100, gpu.h100). Default: cpu |
--file-name, -f | Name for the execution |
--requirements, -r | Requirements file path or pip requirements string |
--import | Pre-import modules (repeatable) |
--use-config / --no-config | Use workspace config from .lyceum/config.json. Default: True |
--debug, -d | Show detailed debug information |
Script arguments can be passed after --: lyceum python run script.py -- --epochs 10
Examples
# Run inline Python code
lyceum python run "print('Hello, World!')"
# Run a Python file
lyceum python run script.py
# Run on a GPU machine
lyceum python run train.py --machine a100
# Run with dependencies
lyceum python run script.py --requirements requirements.txt
# Run with inline requirements
lyceum python run script.py --requirements "numpy pandas scikit-learn"
# Pre-import modules
lyceum python run script.py --import numpy --import pandas
# Pass arguments to your script
lyceum python run train.py -- --epochs 100 --batch-size 32
# Debug mode
lyceum python run script.py --debug
lyceum python config init
Initialize a workspace configuration file at .lyceum/config.json.
lyceum python config init [workspace]
Arguments
| Argument | Description |
|---|
workspace | Workspace directory. Default: . (current directory) |
Options
| Option | Description |
|---|
--requirements, -r | Path to requirements.txt |
--force, -f | Overwrite existing config |
Examples
# Initialize in current directory
lyceum python config init
# Initialize with requirements
lyceum python config init --requirements requirements.txt
# Force overwrite existing config
lyceum python config init --force
lyceum python config show
Display the current workspace configuration.
lyceum python config show
lyceum python config refresh
Refresh the workspace configuration from the server.
lyceum python config refresh