https://www.graalvm.org/python/
GraalVM logo
* Docs
* Guides
* Blog
* Videos
* Community
* Graal Projects
[graalstack] Graal Stack
[gdk] Graal Dev Kit for Micronaut
[graalos] GraalOS
[js-navi] GraalJS
[python-nav] GraalPy
[wasm-navi] GraalWasm
[java-navi] Espresso
[ruby-navi] TruffleRuby
Star
Download
GraalPy
A high-performance embeddable Python 3 runtime for Java
Quick Start Documentation Package Compatibility
Benefits
access icon
Python for Java
Load and use Python packages directly in Java
compatibility icon
Python 3 Compatible
Runs the latest Python AI and Data Science packages
speed icon
Fastest Python on the JVM
Graal JIT compiles Python for native code speed
upgrade icon
Modern Python for the JVM
GraalPy provides an upgrade path for Jython users
code icon
Script Java with Python
Extend applications with Python scripts that interact with Java
classes and framework
binary icon
Simple distribution
Package Python applications as a single binary with GraalVM Native
Image
How to Get Started
[maven-logo]
1. Add GraalPy as a dependency from Maven Central
org.graalvm.polyglot
polyglot
24.1.0
org.graalvm.polyglot
python
24.1.0
pom
[gradle-log]
or
implementation("org.graalvm.polyglot:polyglot:24.1.0")
implementation("org.graalvm.polyglot:python:24.1.0")
[java-logo]
2. Embed Python code in Java
import org.graalvm.polyglot.Context;
try (Context context = Context.create()) {
context.eval("python", "print('Hello from GraalPy!')");
}
[maven-logo]
3. Add GraalPy plugins for additional Python packages (optional)
org.graalvm.python
graalpy-maven-plugin
24.1.0
pyfiglet==1.0.2
process-graalpy-resources
Move from Jython to Modern Python
Move your Jython applications to GraalPy for high performance and
modern language features, while preserving an easy interoperability
with Java.
Learn More
Python Data Science Libraries in Java Applications
NetSuite usecase
play button
close_video
Using Python from Java with GraalVM
GraalPy brings the world of Python data science libraries to Java and
other languages running on GraalVM. Using GraalVM's polyglot
interfaces, it is now easier than ever to embed Python code in Java
applications and with good performance to boot! Oracle GraalVM also
includes sandboxing option to run Python native extensions like
NumPy, SciPy, or Matplotlib in a managed Java application.
Connect with us
Get started with GraalVM
Available for Linux, macOS, and Windows platforms
Get started
Learn
* Guides
* Documentation
* GraalVM SDK Javadoc
* GraalVM Blog
* GraalVM Workshops
* GraalVM Demos
Resources
* Oracle GraalVM
* Oracle Developers
* Oracle Help Center
* Oracle Labs
* Brand Guidelines
More
* Why GraalVM?
* Release Calendar
* Release Notes
* FAQs
* Support
Copyright (c) 2018, 2024, Oracle and/or its affiliates. All rights
reserved. Oracle and Java are registered trademarks. Other names may
be trademarks of their respective owners.