PyMuPDF icon indicating copy to clipboard operation
PyMuPDF copied to clipboard

ImportError: libmupdf.so.24.4: cannot open shared object file: No such file or directory

Open si2w opened this issue 8 months ago • 11 comments

Description of the bug

I am attempting to install PyMuPDF on a Docker container running on an Apple Silicon. The installation is successful, but it is impossible to import the library due to a missing shared object.

How to reproduce the bug

!pip install --upgrade --force-reinstall --no-deps --no-cache-dir PyMuPDF

Collecting PyMuPDF Downloading PyMuPDF-1.24.7-cp311-none-manylinux2014_aarch64.whl.metadata (3.4 kB) Downloading PyMuPDF-1.24.7-cp311-none-manylinux2014_aarch64.whl (3.2 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.2/3.2 MB 4.6 MB/s eta 0:00:00a 0:00:01 Installing collected packages: PyMuPDF Attempting uninstall: PyMuPDF Found existing installation: PyMuPDF 1.24.7 Uninstalling PyMuPDF-1.24.7: Successfully uninstalled PyMuPDF-1.24.7 Successfully installed PyMuPDF-1.24.7

import fitz # PyMuPDF


ImportError Traceback (most recent call last) Cell In[12], line 4 ----> 4 import fitz # PyMuPDF

File /opt/conda/lib/python3.11/site-packages/fitz/init.py:2 1 # pylint: disable=wildcard-import,unused-import,unused-wildcard-import ----> 2 from pymupdf import * 3 from pymupdf import _as_fz_document 4 from pymupdf import _as_fz_page

File /opt/conda/lib/python3.11/site-packages/pymupdf/init.py:29 26 import weakref 27 import zipfile ---> 29 from . import extra 32 # Set up g_out_log and g_out_message from environment variables. 33 # 34 # PYMUPDF_MESSAGE controls the destination of user messages (the message() (...) 43 # stdout. 44 # 46 def _set_stream(name, default):

File /opt/conda/lib/python3.11/site-packages/pymupdf/extra.py:10 8 # Import the low-level C/C++ module 9 if package or "." in name: ---> 10 from . import _extra 11 else: 12 import _extra

ImportError: libmupdf.so.24.4: cannot open shared object file: No such file or directory

The machine is an Apple Silicon M2 (Ventura 13.5). This error happens when using JupyterLab 4.0.11 running inside Docker 24.0.7.

PyMuPDF version

1.24.7

Operating system

MacOS

Python version

3.11

si2w avatar Jun 29 '24 12:06 si2w