the-anylogic-company / AnyLogic-Pypeline

A custom AnyLogic library for running Python inside an AnyLogic model (Java)
https://github.com/the-anylogic-company/AnyLogic-Pypeline/wiki
MIT License
107 stars 27 forks source link

Error with setting up python subprocess (Macbook) #19

Closed IwanHuisman closed 3 years ago

IwanHuisman commented 3 years ago

Hi,

I have the following error when trying to play the "Passing data types 2 demo". I did dowload the pypeline library. Do you have an idea how to solve this?

root.pyCommunicator: Problem with setting up Python Subprocess: Caused by: Input returned null; Error stream line reads: Traceback (most recent call last): File "/var/folders/xt/f4729vqn5zn79c1942d4_tsw0000gn/T/pypeline-server_6617826609874667048.py", line 5, in from json.decoder import JSONDecodeError ImportError: cannot import name JSONDecodeError

t-wolfeadam commented 3 years ago

Hello! AFAIK, that error happens when trying to use Python 2 - what Macs have installed by default. The Pypeline server file (and thus Pypeline more generally) currently only supports Python 3.

The simplest option is to install/use a version of Python 3 and then configure the PyCommunicator to use that version. If you really need to use Python 2 though, you'll need to fork the project and modify the source Pypeline model (which is where the server file is generated from) accordingly.

t-wolfeadam commented 3 years ago

(I'm closing this but feel free to ask any follow ups!)