Py4J is a library written in Python and Java. Currently, Py4J has been tested
with Python 2.6 and Python 2.7 only. You can install
Python by going to the official Python download page.
You also need to install a Java environment, version 6. You can install a Java
environment by going to the official Java download page You will need to download
the JDK if you plan to use the Java compiler, but you only need the JRE if you
are using another compiler, such as the one provided by the Eclipse
Development Environment.
Run easy_installPy4J (don’t forget to prefix with sudo if you install
Py4J system-wide on a *NIX operating system).
Py4J should now be in your PYTHONPATH.
The Py4J Java library is located in share/py4j/py4j0.x.jar. The exact
location depends on the platform and the installation type. Some likely
locations are:
/usr/share/py4j/py4j0.x.jar for system-wide install on Linux.
{virtual_env_dir}/share/py4j/py4j0.x.jar for installation in a
virtual environment.
C:\python27\share\py4j\py4j0.x.jar for system-wide install on
Windows.
Download the latest official release from SourceForge or from PyPI. If you are using a *NIX OS, download
the tar.gz file. If you are using Windows, download the zip file.
Untar/Unzip the file and navigate to the newly created directory, e.g., cdPy4J-0.x.
Run pythonsetup.pyinstall (don’t forget to prefix with sudo if you
install Py4J system-wide).
Py4J should now be in your PYTHONPATH.
The Py4J Java library is located under Py4J-0.x/py4j-java/py4j0.x.jar.
Add this library to your classpath when using Py4J in a Java program.
We will provide detailed instructions to build Py4J in future releases.
Briefly, you need:
Git to download the latest source code.
Execute the command line gitclonehttps://github.com/bartdag/py4j.gitpy4j to download the source code.
Apache ant to build the Py4J Java library. Just
execute the command line antjar in the py4j-java project directory to
build the code and create a jar file.
Sphinx to build the documentation. Just
execute the command line makehtml in the
py4j-web project.
Paver to build the Py4J
Python library. Execute the command line paverbig_release in the
py4j-python directory to create a tar.gz source distribution and an egg
file. The big_release target will also create the jar file and the
documentation and will add them to the source distribution. This means that
you need ant and Sphinx to build the Py4J Python library.
If you notice errors with this documentation, open a ticket and let us know. Please, only open a ticket for feedback or improvements on the docs. To get help, use the links above!