Skip to content

Latexocr error when snip on M1 mac via Rosetta. #230

@jxpeng98

Description

@jxpeng98

Hello,

when I use latexocr to render the code, I got the error after I took the snip.

QTextCursor::setPosition: Position '1' out of range
QTextCursor::setPosition: Position '1' out of range
QTextCursor::setPosition: Position '1' out of range
QTextCursor::setPosition: Position '1' out of range
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/pix2tex/gui.py", line 294, in mouseReleaseEvent
    img = ImageGrab.grab(bbox=(x1, y1, x2, y2), all_screens=True)
  File "/usr/local/lib/python3.9/site-packages/PIL/ImageGrab.py", line 36, in grab
    subprocess.call(args + ["-x", filepath])
  File "/usr/local/Cellar/[email protected]/3.9.16/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 349, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/local/Cellar/[email protected]/3.9.16/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/local/Cellar/[email protected]/3.9.16/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1821, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'screencapture'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/pix2tex/gui.py", line 297, in mouseReleaseEvent
    img = ImageGrab.grab(bbox=(x1//factor, y1//factor, x2//factor, y2//factor), all_screens=True)
  File "/usr/local/lib/python3.9/site-packages/PIL/ImageGrab.py", line 36, in grab
    subprocess.call(args + ["-x", filepath])
  File "/usr/local/Cellar/[email protected]/3.9.16/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 349, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/local/Cellar/[email protected]/3.9.16/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 951, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/local/Cellar/[email protected]/3.9.16/Frameworks/Python.framework/Versions/3.9/lib/python3.9/subprocess.py", line 1821, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'screencapture'
[1]    56044 abort      PATH=/usr/local/bin latexocr

It has the error of screencapture.

May I know how to solve this issue?

Many thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions