Closed thiagofonsecabarros closed 3 days 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
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.
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 _extraImportError: 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