Overview
The Python tool executes code using the CPython 3.14.2 runtime bundled with Noema. It is designed for offline data analysis and scientific computing without sending your code or data to a remote Python service.
The expanded package set documented below is available in Noema 3.7 and later.
- Perform numerical and statistical calculations.
- Analyze tables and CSV files with pandas.
- Build machine-learning models with scikit-learn.
- Create charts with Matplotlib and seaborn.
- Use SciPy for optimization, integration, statistics, signal processing, and linear algebra.
- Perform symbolic mathematics with SymPy.
- Analyze graphs and networks with NetworkX.
- Read and write YAML data.
- Format results as readable tables.
Enabling Python
Python must be enabled globally and turned on for the current conversation before a model can use it.
- Open Settings.
- Select Tools.
- Enable Python.
- Open a conversation.
- Use the tool toggles in the context bar to turn Python on for that conversation.
The selected model must support tool calling. Noema will show Python as unavailable if the embedded runtime fails its health check.
Open the Python page in Settings under Tools to see the installed Python version, package-set identifier, package health, and the complete package list with versions and dependencies.
Bundled packages
The following packages are included with Noema:
| Package | Version | Import name | Primary uses |
|---|---|---|---|
| NumPy | 2.5.1 | numpy | Arrays, numerical computing, random numbers, and linear algebra |
| pandas | 3.0.5 | pandas | DataFrames, CSV processing, grouping, dates, and tabular analysis |
| Matplotlib | 3.11.1 | matplotlib | Scientific charts, subplots, annotations, and custom figures |
| SciPy | 1.18.0 | scipy | Statistics, optimization, integration, FFTs, and scientific algorithms |
| scikit-learn | 1.9.0 | sklearn | Preprocessing, regression, classification, clustering, and model evaluation |
| Pillow | 12.3.0 | PIL | Image creation and processing |
| seaborn | 0.13.2 | seaborn | Statistical visualization built on Matplotlib |
| SymPy | 1.14.0 | sympy | Symbolic algebra, calculus, equations, and exact mathematics |
| NetworkX | 3.6.1 | networkx | Graph algorithms and network analysis |
| PyYAML | 6.0.3 | yaml | Reading and writing YAML |
| tabulate | 0.10.0 | tabulate | Plain-text and Markdown table formatting |
Bundled package dependencies
Noema also bundles the dependencies required by these packages:
| Dependency | Version |
|---|---|
| contourpy | 1.3.3 |
| cycler | 0.12.1 |
| fontTools | 4.63.0 |
| joblib | 1.5.3 |
| kiwisolver | 1.5.0 |
| mpmath | 1.3.0 |
| narwhals | 2.24.0 |
| packaging | 26.2 |
| pyparsing | 3.3.2 |
| python-dateutil | 2.9.0.post0 |
| six | 1.17.0 |
| threadpoolctl | 3.6.0 |
| wcwidth | 0.8.2 |
Package versions may change with Noema updates. The Python help sheet inside the app shows the exact package set installed by your current build.
Commands such as pip install are unsupported. Native Python extensions are compiled, signed, and included with the application.
Creating Matplotlib charts
Noema uses Matplotlib’s non-interactive Agg backend. Interactive desktop windows and GUI backends are unavailable, but completed figures can be displayed directly inside the conversation.
You can display a figure by calling plt.show() or by leaving it open when execution finishes. Noema automatically captures open figures even if later code reports an error.
- Captured charts appear directly below the completed Python tool call.
- Charts can be opened in a zoomable viewer.
- Charts can be shared or saved from the viewer.
- Charts preserve their aspect ratio across iPhone, iPad, Mac, and Vision Pro.
- Inline previews use PNG and are retained with the conversation.
Noema captures up to four figures from one execution. Each inline preview is limited to 1600 × 1200 pixels and 700 KB, with a combined preview limit of 2.8 MB.
Explicitly saved PNG and JPEG files can also be returned as regular artifacts. SVG and PDF figures are not currently displayed inline.
For example, ask: “Use NumPy and Matplotlib to create a sine and cosine chart with labeled axes, a legend, and a grid. Display it inline and save it as trigonometry.png.”
Python or Quick Charts?
| Use Quick Charts when… | Use Python and Matplotlib when… |
|---|---|
| The values are already calculated | The data must be transformed or analyzed first |
| You need a simple bar, line, scatter, or pie chart | You need histograms, heatmaps, regressions, or scientific axes |
| You want a fast native chart | You need annotations, custom styling, or multiple subplots |
| Python is disabled or unavailable | You need NumPy, pandas, SciPy, or scikit-learn integration |
Noema should use only one visualization path for a requested chart. If you explicitly request Quick Charts or Matplotlib, the model should respect that choice.
Execution restrictions
Python runs locally, but it is restricted execution rather than a process-isolated security sandbox.
- Has no network access.
- Cannot create sockets or make HTTP requests.
- Cannot launch subprocesses or shell commands.
- Cannot fork, spawn, or use multiprocessing process backends.
- Cannot load arbitrary dynamic libraries through
ctypes. - Can load only the native extensions bundled and signed with Noema.
- Can read the bundled Python runtime, installed packages, the current execution directory, and approved font directories.
- Can write only to the execution directory and Noema’s bounded Matplotlib cache.
- Limits numerical thread pools to one thread by default.
- Has a 30-second execution timeout.
Code that attempts a prohibited operation will receive an error without weakening the restrictions for the rest of the runtime.
Results and files
A Python execution can return:
- Standard output produced by
print(). - Standard error.
- Exit status and execution time.
- Timeout or runtime errors.
- Matplotlib figures.
- Files created in the execution directory.
Use print() when you want textual results to appear clearly in the tool response. Large binary data is not sent back to the language model, although supported artifacts can remain available to you in the app.
Availability with models and datasets
Python requires a model capable of calling tools.
On-device Apple Foundation Models do not currently execute the Python tool. Private Cloud Compute models can use it when tool calling is available.
For most inference backends, Python is unavailable while a dataset is selected or being indexed. Constellation can coordinate dataset retrieval and Python execution on the originating device where both capabilities are available.
Example prompts
- Use NumPy to generate 1,000 normally distributed values and report their mean, standard deviation, and percentiles.
- Create a pandas DataFrame containing monthly revenue and expenses, calculate profit and growth, and print the result as a Markdown table.
- Use SciPy to minimize the function
(x - 3)² + 2and explain the result. - Train a small scikit-learn linear regression model on sample data, show its coefficients, and plot the fitted line.
- Use seaborn and Matplotlib to create a correlation heatmap for a sample dataset and display it inline.
- Use SymPy to solve
x³ - 6x² + 11x - 6 = 0exactly and verify each solution. - Use NetworkX to create a graph, calculate PageRank and shortest paths, and summarize the most important nodes.
- Create a YAML document containing a project name, milestones, and owners, then parse it back and print the result.
Troubleshooting
- If Python is unavailable, confirm that it is enabled in Settings, turned on using the tool toggles in the context bar, and supported by the selected model. Also check whether a dataset is currently selected.
- If a bundled package fails to import, open the Python help sheet in Settings and check the runtime and package health diagnostics.
- If a chart does not appear, call
plt.show()or leave the figure open. Interactive Matplotlib windows are not supported. - If execution times out, reduce the dataset size, number of iterations, image resolution, or model complexity. Multiprocessing cannot be used to bypass the execution limit.
- If code attempts to download data or install a package, provide the required data as a local attachment or rewrite the task using the packages already bundled with Noema.

