PyNetLogo on Linux cluster - error with pyNetLogo.NetLogoLink

189 views
Skip to first unread message

Marius von Essen

unread,
Sep 2, 2021, 7:41:38 PM9/2/21
to netlogo-devel

Hi everyone,

This is my first post and I hope it's the right place for my question - let me know if there are better places to ask this :-)

I am using PyNetLogo to run a global sensitivity analysis for my model on a computer cluster that runs on Linux centos. I am following the documentation for the Sobol sensitivity analysis from the PyNetLogo documentation pretty closely and this line gives me an error:
netlogo = pyNetLogo.NetLogoLink(gui=False, netlogo_home='/home/users/vonessen/NetLogo 6.2.0', netlogo_version='6')

I'm using Java version 11.0.11, Python 3.6, PyNetLogo 0.4.2, and my model was developed in NetLogo 6.2.0, and the code is in a Jupyter Notebook.

When I run the line above, I get this error message: KeyError: '6'
When I modify the line to netlogo_version='5', I get this error message: java.lang.NoClassDefFoundError: java.lang.NoClassDefFoundError: org/nlogo/util/Exceptions$Handler
See screeenshots for full error messages attached.

Do you have any idea what the issue might be?

Thanks a lot already!

Best,
Marius




NetLogoVersion5.PNG
NetLogoVersion6.PNG

Marius von Essen

unread,
Sep 3, 2021, 5:14:34 PM9/3/21
to netlogo-devel
Quick update, I was actually able to make that line work after installing NetLogo 6.1.0 on the cluster and specifying the version number as netlogo_version='6.1'
Now, when trying to load my model with: netlogo.load_model('/home/users/vonessen/JA-ABM_for_SA_V1_6.1.0.nlogo'), I get the following error message:

NetLogoException: java.lang.NoSuchMethodError: org.nlogo.workspace.Controllable.open(Ljava/lang/String;Z)V

Any thoughts?

Thanks a lot already and wishing a great weekend,
Marius
modelload_error.PNG

Marius von Essen

unread,
Sep 3, 2021, 5:43:50 PM9/3/21
to netlogo-devel
Hi all - sorry for spamming here. I 'downversioned' my model to NetLogo 6.0.4 and now those two lines of the code run - yay!
Now I'm stuck with a NameError: name 'netlogo' is not defined, when executing results = pd.DataFrame(lview.map_sync(simulation, param_values)). I will try to work on that over the weekend, but in case anyone has a suggestion, I'd love to hear it :)

Thanks and all the best,
Marius

Marius von Essen

unread,
Sep 8, 2021, 9:56:57 PM9/8/21
to netlogo-devel
Hello everyone,

Again, sorry for posting so much - I wanted to give a quick update and describe the error in more detail.

I tried to run the script with PyNetLogo versions 0.3, 0.4, 0.4.1, and 0.4.2, unfortunately the error persists. This is the full error message that I receive when running the following line:
results = pd.DataFrame(lview.map_sync(simulation, param_values))

See the full error message (plus screenshot attached).
I am in contact with the service team of the computer cluster I am using, but unfortunately they also ran out of ideas what could cause the error. If anyone has a hunch as how to approach this error I'd be super grateful!

Thanks a lot and apologies again for all the consecutive posts.

Cheers,
Marius

[0:apply]: ---------------------------------------------------------------------------NameError Traceback (most recent call last)<string> in <module> ~/.local/lib/python3.6/site-packages/ipyparallel/client/remotefunction.py in <lambda>(f, *sequences) 141 142 if sys.version_info[0] >= 3: --> 143 _map = lambda f, *sequences: list(map(f, *sequences)) 144 else: 145 _map = map <ipython-input-13-647b15be93cd> in simulation(experiment) NameError: name 'netlogo' is not defined
[1:apply]: ---------------------------------------------------------------------------NameError Traceback (most recent call last)<string> in <module> ~/.local/lib/python3.6/site-packages/ipyparallel/client/remotefunction.py in <lambda>(f, *sequences) 141 142 if sys.version_info[0] >= 3: --> 143 _map = lambda f, *sequences: list(map(f, *sequences)) 144 else: 145 _map = map <ipython-input-13-647b15be93cd> in simulation(experiment) NameError: name 'netlogo' is not defined
[2:apply]: ---------------------------------------------------------------------------NameError Traceback (most recent call last)<string> in <module> ~/.local/lib/python3.6/site-packages/ipyparallel/client/remotefunction.py in <lambda>(f, *sequences) 141 142 if sys.version_info[0] >= 3: --> 143 _map = lambda f, *sequences: list(map(f, *sequences)) 144 else: 145 _map = map <ipython-input-13-647b15be93cd> in simulation(experiment) NameError: name 'netlogo' is not defined
[3:apply]: ---------------------------------------------------------------------------NameError Traceback (most recent call last)<string> in <module> ~/.local/lib/python3.6/site-packages/ipyparallel/client/remotefunction.py in <lambda>(f, *sequences) 141 142 if sys.version_info[0] >= 3: --> 143 _map = lambda f, *sequences: list(map(f, *sequences)) 144 else: 145 _map = map <ipython-input-13-647b15be93cd> in simulation(experiment) NameError: name 'netlogo' is not defined ... 60 more exceptions ...
Capture.PNG
Reply all
Reply to author
Forward
0 new messages