This branch requires Python 3.14.
Install pyenv https://github.com/pyenv/pyenv and pyenv-virtualenv https://github.com/pyenv/pyenv-virtualenv for your OS. Using pyenv and pyenv-virtualenv, you can install specific Python versions and create virtual environments within.
After installing pyenv and configuring your shell's environment variables (like ~/.zshrc or ~/.bashrc), you must restart your terminal session for the changes to take effect.
You can create install Python 3.14, create a virtual environment and activate it using the following commands:
pyenv install 3.14
pyenv virtualenv 3.14 mypyenv-3.14
pyenv activate mypyenv-3.14-
You can skip the next two steps if you do not want to re-generate jextract binding classes from Python C API.
-
Download & extract jextract early access binary from
-
Put jextract in PATH
-
Install JDK 25 and define JAVA_HOME to be JDK 25 home
-
From the current directory
mvn clean verify surefire-report:report javadoc:javadoccommand builds and tests the project
- From the current directory:
sh jpython.shruns a simple REPL. or
sh jpython.sh samples/squares.pyruns a sample script file
- To run a java sample that uses Python script engine:
sh run.sh samples/Hello.java- Recommended usage note
The CPython runtime provides access to many operating system features and resources. As such, using detroit-python to run arbitrary or untrusted Python code is strongly discouraged.
Moreover, even when running trusted Python code, it is recommended that script code be not interpolated with user input arguments without proper validation.