pymupdf / PyMuPDF

PyMuPDF is a high performance Python library for data extraction, analysis, conversion & manipulation of PDF (and other) documents.
https://pymupdf.readthedocs.io
GNU Affero General Public License v3.0
4.49k stars 443 forks source link

ImportError: DLL load failed while importing _extra: The specified module could not be found. #3598

Closed thiagofonsecabarros closed 3 days ago

thiagofonsecabarros commented 1 week ago

Description of the bug

Tried reinstalling, changed policy in powershell but nothing have worked so far.

Error log:


ImportError Traceback (most recent call last) Cell In[29], line 1 ----> 1 import fitz # PyMuPDF 3 def test_pymupdf(): 4 try:

File c:\Users\thiag\AppData\Local\Programs\Python\Python311\Lib\site-packages\fitz__init.py:2 [1](file:///C:/Users/thiag/AppData/Local/Programs/Python/Python311/Lib/site-packages/fitz/init.py:1) # pylint: disable=wildcard-import,unused-import,unused-wildcard-import ----> [2](file:///C:/Users/thiag/AppData/Local/Programs/Python/Python311/Lib/site-packages/fitz/init.py:2) from pymupdf import * [3](file:///C:/Users/thiag/AppData/Local/Programs/Python/Python311/Lib/site-packages/fitz/init__.py:3) from pymupdf import _as_fz_document 4 from pymupdf import _as_fz_page

File c:\Users\thiag\AppData\Local\Programs\Python\Python311\Lib\site-packages\pymupdf__init.py:29 [26](file:///C:/Users/thiag/AppData/Local/Programs/Python/Python311/Lib/site-packages/pymupdf/init.py:26) import weakref [27](file:///C:/Users/thiag/AppData/Local/Programs/Python/Python311/Lib/site-packages/pymupdf/init.py:27) import zipfile ---> [29](file:///C:/Users/thiag/AppData/Local/Programs/Python/Python311/Lib/site-packages/pymupdf/init.py:29) from . import extra [32](file:///C:/Users/thiag/AppData/Local/Programs/Python/Python311/Lib/site-packages/pymupdf/init.py:32) # Set up g_out_log and g_out_message from environment variables. [33](file:///C:/Users/thiag/AppData/Local/Programs/Python/Python311/Lib/site-packages/pymupdf/init.py:33) # [34](file:///C:/Users/thiag/AppData/Local/Programs/Python/Python311/Lib/site-packages/pymupdf/init__.py:34) # PYMUPDF_MESSAGE controls the destination of user messages (the message() (...) 43 # stdout. 44 # 46 def _set_stream(name, default): ... ---> 10 from . import _extra 11 else: 12 import _extra

ImportError: DLL load failed while importing _extra: The specified module could not be found.

How to reproduce the bug

pip install pymupdf

import fitz

def test_pymupdf(): try: doc = fitz.open("iec60730_sample_pics.pdf") print("PDF opened successfully") except Exception as e: print(f"An error occurred: {e}")

test_pymupdf()

PyMuPDF version

1.24.5

Operating system

Windows

Python version

3.11

julian-smith-artifex-com commented 1 week ago

This looks like a known problem outside of PyMuPDF, caused by a missing MSVCP140.dll file.

Please see: https://pymupdf.readthedocs.io/en/latest/installation.html#problems-after-installation

julian-smith-artifex-com commented 3 days ago

I'll close this as it looks like a known issue with Windows that is outside the control of PyMuPDF. Please add a comment and/or re-open if you have more information.