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

Conflict with opencv #240

Open
WiserOrb opened this issue May 6, 2022 · 5 comments
Open

Conflict with opencv #240

WiserOrb opened this issue May 6, 2022 · 5 comments
Labels

Comments

@WiserOrb
Copy link

WiserOrb commented May 6, 2022

Hi, I've encountered a breaking bug when trying to use oct2py and opencv (cv2)
It crashes if:

  1. import cv2 before oct2py
  2. import oct2py, import cv2, calling Oct2Py()

How it breaks

import cv2

import oct2py #here it breaks
import oct2py
import cv2

oc = oct2py.Oct2Py() #here it breaks
import oct2py
oc = oct2py.Oct2Py() #create before importing cv2 as a workaround
#this instance works as expected

import cv2
oc = oct2py.Oct2Py() #here it breaks

Python version: 3.10.4
oct2py: 5.5.1
octave: 6.4.0
opencv: 4.5.5.64

@blink1073
Copy link
Owner

What operating system? It seems to be working for me on macOS 12.3.1 with packages installed from conda-forge, except for Octave, which I got from homebrew.

Python version: 3.10.4
opencv: 4.5.5
octave: 6.4.0

In [1]: import cv2
In [2]: import oct2py
In [3]: oc = oct2py.Oct2Py()
In [4]: oc.ones()
Out[4]: 1.0

@WiserOrb
Copy link
Author

WiserOrb commented May 6, 2022

Ubuntu 22.04

@blink1073
Copy link
Owner

Are you getting an error of the form ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 96 from C header, got 80 from PyObject?

@WiserOrb
Copy link
Author

WiserOrb commented May 9, 2022

No, I get an EOF exception

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/diego/.local/lib/python3.10/site-packages/oct2py/__init__.py", line 38, in <module>
    octave = Oct2Py()
  File "/home/diego/.local/lib/python3.10/site-packages/oct2py/core.py", line 83, in __init__
    self.restart()
  File "/home/diego/.local/lib/python3.10/site-packages/oct2py/core.py", line 533, in restart
    self._engine = OctaveEngine(stdin_handler=self._handle_stdin,
  File "/home/diego/.local/lib/python3.10/site-packages/octave_kernel/kernel.py", line 176, in __init__
    self.repl = self._create_repl()
  File "/home/diego/.local/lib/python3.10/site-packages/octave_kernel/kernel.py", line 402, in _create_repl
    repl = REPLWrapper(cmd, orig_prompt, change_prompt,
  File "/home/diego/.local/lib/python3.10/site-packages/metakernel/replwrap.py", line 88, in __init__
    self.set_prompt(prompt_regex,
  File "/home/diego/.local/lib/python3.10/site-packages/metakernel/replwrap.py", line 112, in set_prompt
    self.child.expect(prompt_regex)
  File "/usr/lib/python3/dist-packages/pexpect/spawnbase.py", line 343, in expect
    return self.expect_list(compiled_pattern_list,
  File "/usr/lib/python3/dist-packages/pexpect/spawnbase.py", line 372, in expect_list
    return exp.expect_loop(timeout)
  File "/usr/lib/python3/dist-packages/pexpect/expect.py", line 179, in expect_loop
    return self.eof(e)
  File "/usr/lib/python3/dist-packages/pexpect/expect.py", line 122, in eof
    raise exc
pexpect.exceptions.EOF: End Of File (EOF). Exception style platform.
<pexpect.pty_spawn.spawn object at 0x7f8be10fc820>
command: /usr/bin/octave
args: [b'/usr/bin/octave', b'--interactive', b'--quiet', b'--no-init-file']
buffer (last 100 chars): ''
before (last 100 chars): 'em.\r\n\r\nAvailable platform plugins are: xcb, eglfs, linuxfb, minimal, minimalegl, offscreen, vnc.\r\n\r\n'
after: <class 'pexpect.exceptions.EOF'>
match: None
match_index: None
exitstatus: None
flag_eof: True
pid: 94481
child_fd: 6
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.*>')

@blink1073
Copy link
Owner

Ah, so the Octave process is crashing. I'm not quite sure what else to try.

@blink1073 blink1073 added the bug label May 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants