Getting Started
Setting up Python4J — Maven dependencies, executing Python code, and variable I/O
Maven Setup
<dependency>
<groupId>org.nd4j</groupId>
<artifactId>python4j-core</artifactId>
<version>${dl4j.version}</version>
</dependency><dependency>
<groupId>org.nd4j</groupId>
<artifactId>python4j-numpy</artifactId>
<version>${dl4j.version}</version>
</dependency>System.setProperty("org.eclipse.python4j.path", "/home/user/myenv/lib/python3.9");First Execution
Passing Variables into Python
Supported Types
Constant
Python type
Java type
Reading Variables Back
Running a Python Script File
A Worked Example: Calling scikit-learn
Error Handling
Next Steps
Last updated
Was this helpful?