Opened 7 years ago

Closed 7 years ago

#4493 closed defect (worksforme)

OMCSessionZMQ cannot connect to server

Reported by: marco.forgione1986@… Owned by: Alachew Mengist
Priority: high Milestone:
Component: OMPython Version: v1.12.0
Keywords: Cc:

Description

The script

=========================================
import OMPython
import scipy.io as sio
import matplotlib.pyplot as plt

omc_session = OMPython.OMCSessionZMQ()
=======================================

returns the error
===========================================================

File "<ipython-input-7-e274c1c643a8>", line 1, in <module>

runfile('/home/marco/Desktop/whirlpool_all/modelica/OMPython-master-new/ompython_test_2.py', wdir='/home/marco/Desktop/whirlpool_all/modelica/OMPython-master-new')

File "/home/marco/anaconda3/lib/python3.6/site-packages/spyder/utils/site/sitecustomize.py", line 880, in runfile

execfile(filename, namespace)

File "/home/marco/anaconda3/lib/python3.6/site-packages/spyder/utils/site/sitecustomize.py", line 102, in execfile

exec(compile(f.read(), filename, 'exec'), namespace)

File "/home/marco/Desktop/whirlpool_all/modelica/OMPython-master-new/ompython_test_2.py", line 17, in <module>

omc_session = OMPython.OMCSessionZMQ()

File "/home/marco/Desktop/whirlpool_all/modelica/OMPython-master-new/OMPython/init.py", line 500, in init

self._connect_to_omc()

File "/home/marco/Desktop/whirlpool_all/modelica/OMPython-master-new/OMPython/init.py", line 526, in _connect_to_omc

raise Exception

Exception
======================================================================

using python3 on linu. I has to change the line 116 OMPython/init.py to:

self._random_string = uuid.uuid4().hex + 'aa'

Now it works correctly for me.

Change History (2)

comment:1 by anonymous, 7 years ago

I cannot reproduce this, it just works for me.
Could you try again after installing the latest OMPython master?

python -m pip install https://github.com/OpenModelica/OMPython/archive/master.zip

If the problem persists and you have a fix for it, please submit as a PR to the OMPython repository here:
https://github.com/OpenModelica/OMPython

comment:2 by Martin Sjölund, 7 years ago

Milestone: Future
Resolution: worksforme
Status: newclosed
Note: See TracTickets for help on using tickets.