GraalVM Python Interpreter

Jakob Jenkov
Last update: 2022-01-05

GraalVM has a Python interpreter but it is does not come installed with the base image of GraalVM. You can install the GraalVM Python interpreter in case you need it. At the time of writing, the GraalVM Python interpreter was not available for Windows (only Linux), so if there are any errors in the following, please point them out to me (find me on Twitter / LinkedIn / elsewhere ).

Installing the GraalVM Python Interpreter

To install the GraalVM Python interpreter you must go to the bin directory of where you installed GraalVM to (unzipped it to), and run the following command:

gu install python

This should install the GraalVM Python interpreter. When installed, you can run python code using the graalpython command (via the command line).

Note: At the time of writing, when running the GraalVM Python installation command on Windows, you get an output that looks like this:

Downloading: Release index file from oca.opensource.oracle.com
Downloading: Component catalog from www.graalvm.org
Error: Unknown component: python

To see what modules are available on your platform (e.g. Windows) you can run this GraalVM command:

gu available

Running Python with graalvmpython

Once you have the GraalVM Python interpreter installed, you can run a Python program (stored in a file) like this:

graalvmpython my-python-script.py

Jakob Jenkov

Featured Videos















Core Software Performance Optimization Principles




Advertisements

High-Performance
Java Persistence
Close TOC

All Trails

Trail TOC

Page TOC

Previous

Next