PLANit-Python
In this section we guide you through the installation process for PLANit-Python.
Prerequisites
- Python 3.6 or higher installed (installing Python)
- older versions are not tested
- Java 11 or higher installed (installing Java)
- Older versions are not tested
If you do not have either Python or Java installed, follow the directions below to do so before commencing to Installing PLANit-Python
Installing python
To Install Python, see the Python website. Python is recommended to be on your path, so you can invoke it from anywhere on the console by just typing in python
.
When you type in
python --version
in your console it should output the currently installed version. If it is not, you get a message like the following:'python' is not recognized as an internal or external command, operable program or batch file.
. This means, thepython.exe
file is not yet part of your path.
To include Python on your path do the following:
Windows:
- Locate the installation directory of Python
- Find and open the ‘environment variables’ window, for example via the control panel
- Under the system variables, find the ‘path’ entry. Open it, and add a new line with the installation directory of Python
- Apply the changes, close your console window
- Open a new console window, and try
python --version
again, it should now show the version
Mac:
- Locate the installation directory of Python
- Open a terminal and enter : sudo nano /etc/paths. Enter your password when prompted. (nano is a text editor to edit the path in)
- The directories currently part of your PATH appear, now add the path of the Python install directory at the end.
- Press control + X to quit and Y to save changes
- Open a new console window, and try
python --version
again, it should now show the version
Installing Java
Personal and academic use:
It is easiest to stick to the Oracle implementation since these are up to data and free of charge for non-commercial use. Java 11 can be downloaded from:
The Oracle open JDK version is available via
Commercial use:
If you want to use PLANit-Python, extend it, and embed it in a commercial product, you best avoid using the Oracle Java implementation unless you are willing to pay a subscription fee or get into trouble later down the road because of proprietary components, even in their openJDK implementation. No worries though, there are other capable open-source openJDK implementations. Some links below:
- Unix/Linux based openjdk distributions
- adoptopenJDK for Windows and Mac
Add Java to your path:
After the download, install Java and add it to your path. this allows you to run the java
command directly from the command line. This is expected by the PLANit-Python installation, so make sure this is done, if not already.
See installing Python, for instruction on how to add a directory to your path. In case of Java, you will want to add the
<path_to_java_dir>/bin
directory to the path. If you don’t PLANit-Python will not work as it expects to be able to fire up a java process without being told where the Java installation resides.
Installing PLANit-Python
We assume Python and Java are installed as described above, and are available on the path. If not, do so first.
We use pip
for an easy installation of PLANit-Python in you Python environment. So, make sure that pip is installed. You can check by just running the pip
command in the console which should list options. If it can’t find it, then it is not yet installed. However, it should be since it is included in Python version 3.4 or higher. (Installing pip)
Make sure pip
is updated to the latest version via:
Windows:
python -m pip install -U pip
Linux/MacOs
pip install -U pip
Official releases of PLANit-python are available to you from PyPi which is automatically available through pip
.
To get the latest official release of PLANit-Python, run the following line from the console:
pip install PLANit-Python
This should install the planit-python package as well as its dependencies into your Python installation.
Congrats! You now have succesfully installed PLANit-Python
Non-official and test releases will occasionally be made available via Test.PyPi. If you want to install from this testing platform make sure you include the release version that you are after and add test.pypi as an extra url. This way pip will be able to find the location of the unofficial release, e.g.,
pip install PLANit-Python==0.0.4a7 --extra-index-url https://test.pypi.org/simple/
Getting Started
Now that you have installed all the necessary components. Have a look at the Getting Started, to create your first PLANit-Python application