Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pop up Octave kernel windows in Jupyter #206

Closed
mserouar opened this issue Jan 17, 2022 · 1 comment
Closed

Pop up Octave kernel windows in Jupyter #206

mserouar opened this issue Jan 17, 2022 · 1 comment

Comments

@mserouar
Copy link

mserouar commented Jan 17, 2022

HI !

Each time I try to import Oct2Py on a Jupyter Lab/Notebook a Pop up Octave kernel windows appears and then nothing happens until I interrupt Jupyter cells (I'm on Linux). If not I have a TIMEOUT: Timeout exceeded. error

Is there a known way for this issue ?

Thanks a lot !

Octave kernel v0.34.0
Metakernel v0.28.2
Python v3.7.4 (default, Aug 13 2019, 20:35:49) 
[GCC 7.3.0]
from oct2py import Oct2Py`
oc = Oct2Py()`
---------------------------------------------------------------------------
TIMEOUT                                   Traceback (most recent call last)
~/anaconda3/lib/python3.7/site-packages/pexpect/expect.py in expect_loop(self, timeout)
    110                 # Still have time left, so read more data
--> 111                 incoming = spawn.read_nonblocking(spawn.maxread, timeout)
    112                 if self.spawn.delayafterread is not None:

~/anaconda3/lib/python3.7/site-packages/pexpect/pty_spawn.py in read_nonblocking(self, size, timeout)
    508         else:
--> 509             raise TIMEOUT('Timeout exceeded.')
    510 

TIMEOUT: Timeout exceeded.

During handling of the above exception, another exception occurred:

TIMEOUT                                   Traceback (most recent call last)
<ipython-input-2-a1167d5c5b6e> in <module>
----> 1 from oct2py import Oct2Py

~/anaconda3/lib/python3.7/site-packages/oct2py/__init__.py in <module>
     36 
     37 try:
---> 38     octave = Oct2Py()
     39 except Oct2PyError as e:
     40     print(e)

~/anaconda3/lib/python3.7/site-packages/oct2py/core.py in __init__(self, logger, timeout, oned_as, temp_dir, convert_to_float, backend)
     78         self._user_classes = dict()
     79         self._function_ptrs = dict()
---> 80         self.restart()
     81 
     82     @property

~/anaconda3/lib/python3.7/site-packages/oct2py/core.py in restart(self)
    525 
    526         self._engine = OctaveEngine(stdin_handler=self._handle_stdin,
--> 527                                     logger=self.logger)
    528 
    529         # Add local Octave scripts.

~/anaconda3/lib/python3.7/site-packages/octave_kernel/kernel.py in __init__(self, error_handler, stream_handler, line_handler, stdin_handler, plot_settings, inline_toolkit, defer_startup, cli_options, logger)
    174         self.cli_options = cli_options
    175         self.inline_toolkit = inline_toolkit
--> 176         self.repl = self._create_repl()
    177         self.error_handler = error_handler
    178         self.stream_handler = stream_handler

~/anaconda3/lib/python3.7/site-packages/octave_kernel/kernel.py in _create_repl(self)
    397         repl = REPLWrapper(cmd, orig_prompt, change_prompt,
    398                            stdin_prompt_regex=STDIN_PROMPT_REGEX,
--> 399                            force_prompt_on_continuation=True)
    400         if os.name == 'nt':
    401             repl.child.crlf = '\n'

~/anaconda3/lib/python3.7/site-packages/metakernel/replwrap.py in __init__(self, cmd_or_spawn, prompt_regex, prompt_change_cmd, new_prompt_regex, continuation_prompt_regex, stdin_prompt_regex, extra_init_cmd, prompt_emit_cmd, force_prompt_on_continuation, echo)
     88             self.set_prompt(prompt_regex,
     89                             prompt_change_cmd.format(new_prompt_regex,
---> 90                                                      continuation_prompt_regex))
     91             self.prompt_regex = new_prompt_regex
     92         self.continuation_prompt_regex = continuation_prompt_regex

~/anaconda3/lib/python3.7/site-packages/metakernel/replwrap.py in set_prompt(self, prompt_regex, prompt_change_cmd)
    110 
    111     def set_prompt(self, prompt_regex, prompt_change_cmd):
--> 112         self.child.expect(prompt_regex)
    113         self.sendline(prompt_change_cmd)
    114         self.prompt_change_cmd = prompt_change_cmd

~/anaconda3/lib/python3.7/site-packages/pexpect/spawnbase.py in expect(self, pattern, timeout, searchwindowsize, async_, **kw)
    339         compiled_pattern_list = self.compile_pattern_list(pattern)
    340         return self.expect_list(compiled_pattern_list,
--> 341                 timeout, searchwindowsize, async_)
    342 
    343     def expect_list(self, pattern_list, timeout=-1, searchwindowsize=-1,

~/anaconda3/lib/python3.7/site-packages/pexpect/spawnbase.py in expect_list(self, pattern_list, timeout, searchwindowsize, async_, **kw)
    367             return expect_async(exp, timeout)
    368         else:
--> 369             return exp.expect_loop(timeout)
    370 
    371     def expect_exact(self, pattern_list, timeout=-1, searchwindowsize=-1,

~/anaconda3/lib/python3.7/site-packages/pexpect/expect.py in expect_loop(self, timeout)
    117             return self.eof(e)
    118         except TIMEOUT as e:
--> 119             return self.timeout(e)
    120         except:
    121             self.errored()

~/anaconda3/lib/python3.7/site-packages/pexpect/expect.py in timeout(self, err)
     80             if err is not None:
     81                 msg = str(err) + '\n' + msg
---> 82             raise TIMEOUT(msg)
     83 
     84     def errored(self):

TIMEOUT: Timeout exceeded.
<pexpect.pty_spawn.spawn object at 0x7f9c3840ea50>
command: /usr/bin/octave
args: [b'/usr/bin/octave', b'--interactive', b'--quiet', b'--no-init-file']
buffer (last 100 chars): ''

after: <class 'pexpect.exceptions.TIMEOUT'>
match: None
match_index: None
exitstatus: None
flag_eof: False
pid: 23937
child_fd: 47
closed: False
timeout: 30
delimiter: <class 'pexpect.exceptions.EOF'>
logfile: None
logfile_read: None
logfile_send: None
maxread: 2000
ignorecase: False
searchwindowsize: None
delaybeforesend: 0.05
delayafterclose: 0.1
delayafterterminate: 0.1
searcher: searcher_re:
    0: re.compile('octave.*>')
@mserouar
Copy link
Author

mserouar commented Jan 17, 2022

import os
os.environ['OCTAVE_EXECUTABLE'] = '/usr/bin/octave-cli'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant