Error using Dynare in Oc2py

Good afternoon everyone,

I am running a code from Galí-Monacelli (2005) using dynare in Oc2py and the session dies.

I tried running the driver.m from Oc2py and I get the same error. Then I changed the timeout = None and timeout = 1e6 and the problem continues. If I run Gali (2008) there is not problem.

The codes runs fine from Octave. Here the error:

OpenJDK 64-Bit Server VM warning: Archived non-system classes are disabled because the java.system.class.loader property is specified (value = "org.octave.OctClassLoader"). To use archived non-system classes, this property must be not be set
Using 64-bit preprocessor
Starting Dynare (version 4.6.0).
Calling Dynare with arguments: none
Starting preprocessing of the model file ...
Found 19 equation(s).
Evaluating expressions...done
Computing static model derivatives (order 1).
Computing dynamic model derivatives (order 2).
Processing outputs ...
Preprocessing completed. 

EOF                                       Traceback (most recent call last)
~/miniconda3/lib/python3.9/site-packages/oct2py/ in _feval(self, func_name, func_args, dname, nout, timeout, stream_handler, store_as, plot_dir)
    562         try:
--> 563             engine.eval('_pyeval("%s", "%s");' % (out_file, in_file),
    564                         timeout=timeout)

~/miniconda3/lib/python3.9/site-packages/octave_kernel/ in eval(self, code, timeout, silent)
    246             else:
--> 247                 raise e

~/miniconda3/lib/python3.9/site-packages/octave_kernel/ in eval(self, code, timeout, silent)
    231         try:
--> 232             resp = self.repl.run_command(code.rstrip(),
    233                                          timeout=timeout,

~/miniconda3/lib/python3.9/site-packages/metakernel/ in run_command(self, command, timeout, stream_handler, line_handler, stdin_handler)
    241         # Command was fully submitted, now wait for the next prompt
--> 242         if self._expect_prompt(timeout=timeout) == 1:
    243             # We got the continuation prompt - command was incomplete

~/miniconda3/lib/python3.9/site-packages/metakernel/ in _expect_prompt(self, timeout)
    130         while True:
--> 131             pos = self.child.expect(expects, timeout=timeout)
    132             # got a full prompt or continuation prompt.

~/miniconda3/lib/python3.9/site-packages/pexpect/ in expect(self, pattern, timeout, searchwindowsize, async_, **kw)
    342         compiled_pattern_list = self.compile_pattern_list(pattern)
--> 343         return self.expect_list(compiled_pattern_list,
    344                 timeout, searchwindowsize, async_)

~/miniconda3/lib/python3.9/site-packages/pexpect/ in expect_list(self, pattern_list, timeout, searchwindowsize, async_, **kw)
    371         else:
--> 372             return exp.expect_loop(timeout)

~/miniconda3/lib/python3.9/site-packages/pexpect/ in expect_loop(self, timeout)
    178         except EOF as e:
--> 179             return self.eof(e)
    180         except TIMEOUT as e:

~/miniconda3/lib/python3.9/site-packages/pexpect/ in eof(self, err)
    121             exc.__cause__ = None # in Python 3.x we can use "raise exc from None"
--> 122             raise exc

EOF: End Of File (EOF). Exception style platform.
<pexpect.pty_spawn.spawn object at 0x7f481c7a8100>
command: /usr/bin/octave-cli
args: [b'/usr/bin/octave-cli', b'--interactive', b'--quiet', b'--no-init-file']
buffer (last 100 chars): ''
before (last 100 chars): ''
after: <class 'pexpect.exceptions.EOF'>
match: None
match_index: None
exitstatus: None
flag_eof: True
pid: 20935
child_fd: 74
closed: False
timeout: 30
delimiter: <class 'pexpect.exceptions.EOF'>
logfile: None
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: None
delayafterclose: 0.1
delayafterterminate: 0.1
searcher: searcher_re:
    0: re.compile('PEXPECT_PROMPT>')
    1: re.compile('PEXPECT_PROMPT_')
    2: re.compile('\\A.+?__stdin_prompt>|debug> ')
    3: re.compile('\r\n')

During handling of the above exception, another exception occurred:

Oct2PyError                               Traceback (most recent call last)
<ipython-input-39-d8af0fd933a9> in <module>
----> 1 run_model()

<ipython-input-38-9461382384fc> in run_model()
      1 def run_model():
      2     oc = Oct2Py(timeout = None);
----> 3     oc.dynare('gali3.mod', timeout = None);
      4     return df

~/miniconda3/lib/python3.9/site-packages/oct2py/ in __call__(self, *inputs, **kwargs)
     94                         for item in pair)
---> 96         return self._ref().feval(, *inputs, **kwargs)
     98     def __repr__(self):

~/miniconda3/lib/python3.9/site-packages/oct2py/ in feval(self, func_path, *func_args, **kwargs)
    378             stream_handler = if verbose else self.logger.debug
--> 380         return self._feval(func_name, func_args, dname=dname, nout=nout,
    381                           timeout=timeout, stream_handler=stream_handler,
    382                           store_as=store_as, plot_dir=plot_dir)

~/miniconda3/lib/python3.9/site-packages/oct2py/ in _feval(self, func_name, func_args, dname, nout, timeout, stream_handler, store_as, plot_dir)
    574             stream_handler(engine.repl.child.before)
    575             self.restart()
--> 576             raise Oct2PyError('Session died, restarting')
    578         # Read in the output.

Oct2PyError: Session died, restarting

Any help is appreciated.
Best regards,

It’s hard to tell as we don’t have access to the same setup. Did you make sure that the Dynare and Octave version are compatible?