Python support is experimental in 1.6.0.
Elide runs Python 3.13 with its standard library; no CPython install is needed. Python is an optional component:
elide setup python--channel=release or --channel=nightly picks the channel, and --force reinstalls. apt and RPM installs cannot
add it; Installation lists the methods that can. Without the component, a Python command
prints Python support is not installed. Run 'elide setup python' to add it. and exits 2.
Run Python
elide python takes the same arguments as python:
elide python app.py --name Elide --count 2 # sys.argv: ['app.py', '--name', 'Elide', '--count', '2']
elide python -c 'import sys; print(sys.version)'
elide python -m json.tool input.json
echo 'print("from stdin")' | elide python -Every token after the script, -c CMD, or -m MODULE is a program argument. Bare elide python starts the REPL
in a terminal and reads standard input otherwise.
The general commands also run .py files, with the same sys.argv:
elide app.py
elide run app.py
elide -l python -s 'print(1 + 1)'Interpreter options
These go before the script, -c, or -m. elide --help-all lists them under “Python interpreter options”.
| Flag | Effect |
|---|---|
-c CMD | Run CMD as the program; trailing tokens become sys.argv[1:]. |
-m MODULE | Run a library module as __main__. |
-s | Don’t add the user site directory to sys.path. |
-I | Isolated mode. |
-E | Ignore PYTHON* environment variables. |
-S | Don’t import site on startup. |
-P | Don’t prepend a potentially unsafe path to sys.path. |
-B | Don’t write bytecode files. |
-u | Unbuffered standard output and error. |
-O | Optimization level; repeat for -OO. |
-b | Warn on bytes/str comparisons; repeat to raise errors. |
-W ARG | Warning control; repeatable. |
-x | Accepted for compatibility; no effect. |
Standard library
The Python 3.13 standard library is included, among it json, pathlib, sqlite3, ssl, zlib, and
ctypes. bz2 and lzma need no system libbz2 or liblzma.
JavaScript interop
With --interop, Python evaluates JavaScript through the built-in elide module:
# sum.py
from elide import js
print(js("[1, 2, 3].reduce((a, b) => a + b, 0)"))elide --interop python sum.pyJavaScript and TypeScript import a Python module’s default export:
// main.mjs
import mod from "./mod.py";
console.log(mod.hello());elide --interop run main.mjsWithout --interop, these calls fail. See Languages and Interop.
Third-party packages
Elide does not install PyPI packages: elide install skips dependencies.pypi, and
elide install --ecosystems=pypi exits 2. Packages in a Python 3.13 virtual environment load when VIRTUAL_ENV
points at it:
export VIRTUAL_ENV=/path/to/venv
elide python app.pyElide reads the environment’s lib/python3.13/site-packages.
Known limitations
- C extensions: some C extension modules do not load.
- macOS: native module isolation is not available.
- WebAssembly SIMD: installing Python disables it; see WebAssembly with Elide.
- CPython differences: some edge cases behave differently from CPython 3.13; see the Compatibility Matrix.