Leo
(Leo Romero)
5 February 2025 12:42
1
I have a problem with DocTest.VisualTest library: Error importing library ‘DocTest.VisualTest’: ImportError: Error loading DLL when importing _extra.
The message in the robot is: No keyword found with name ‘Compare Images’.
I tried several ways and I can’t find the solution
I’m using PyCharm Community Edition
What can I do?
Many
(Many Kasiriha)
5 February 2025 12:48
2
Have you checked the installation instructions?
Are you running on windows?
Robot Framework DocTest library. Simple Automated Visual Document Testing.
Leo
(Leo Romero)
5 February 2025 13:16
3
The error is on Windows 10. It does not occur on Windows 11.
ImportError: DLL load failed while importing extra: The specified module cannot be found.
Traceback (most recent call last):
File “C:\code\VMRSeriesTest.venv\Lib\site-packages\DocTest\VisualTest.py”, line 2, in
from DocTest.CompareImage import CompareImage
File “C:\code\VMRSeriesTest.venv\Lib\site-packages\DocTest\CompareImage.py”, line 19, in
import fitz
File "C:\code\VMRSeriesTest.venv\Lib\site-packages\fitz_init .py", line 2, in
from pymupdf import *
File “C:\code\VMRSeriesTest.venv\Lib\site-packages\pymupdf_init _.py”, line 30, in
from . import extra
File “C:\code\VMRSeriesTest.venv\Lib\site-packages\pymupdf\extra.py”, line 10, in
from . import _extra
Leo
(Leo Romero)
5 February 2025 13:22
4
I’m using Python 3.12 (Windows 10) and the instructions for installing on Windows don’t mention this error.
Many
(Many Kasiriha)
5 February 2025 13:43
5
mhm, interesting.
Could you please do a “pip list” and give the versions of robotframework-doctestlibrary and pymupdf ?
Many
(Many Kasiriha)
5 February 2025 13:46
6
I’m also seeing this error on the PyMuPDF site:
Leo
(Leo Romero)
5 February 2025 13:53
7
Package Version
comtypes 1.4.9
deepdiff 8.2.0
imageio 2.37.0
imutils 0.5.4
lazy_loader 0.4
lxml 5.3.0
MouseInfo 0.1.3
networkx 3.4.2
numpy 1.26.4
opcua 0.98.13
opencv-python-headless 4.11.0.86
orderly-set 5.3.0
packaging 24.2
parsimonious 0.10.0
pillow 11.1.0
pip 23.2.1
PyAutoGUI 0.9.54
PyGetWindow 0.0.9
pylibdmtx 0.1.10
PyMsgBox 1.0.9
PyMuPDF 1.25.2
pyperclip 1.9.0
PyRect 0.2.0
PyScreeze 1.0.1
pytesseract 0.3.13
python-dateutil 2.9.0.post0
pytweening 1.2.0
pytz 2025.1
pywin32 308
pywinauto 0.6.9
pyzbar 0.1.9
regex 2024.11.6
robotframework 7.2
robotframework-doctestlibrary 0.23.0
scikit-image 0.25.1
scipy 1.15.1
setuptools 75.8.0
six 1.17.0
tifffile 2025.1.10
Wand 0.6.13
Many
(Many Kasiriha)
5 February 2025 14:04
8
Could you try to install pymupdf with a lower version, like
pip install pymupdf==1.24.14
Just wondering if something changed there…
Many
(Many Kasiriha)
5 February 2025 14:07
9
Also seeing the issue reported here at PyMuPDF
opened 05:13AM - 20 Jun 24 UTC
closed 09:01PM - 27 Jun 24 UTC
not a bug
### 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](vscode-notebook-cell:?execution_count=29&line=1)
----> [1](vscode-notebook-cell:?execution_count=29&line=1) import fitz # PyMuPDF
[3](vscode-notebook-cell:?execution_count=29&line=3) def test_pymupdf():
[4](vscode-notebook-cell:?execution_count=29&line=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](file:///C:/Users/thiag/AppData/Local/Programs/Python/Python311/Lib/site-packages/fitz/__init__.py: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](file:///C:/Users/thiag/AppData/Local/Programs/Python/Python311/Lib/site-packages/pymupdf/__init__.py:43) # stdout.
[44](file:///C:/Users/thiag/AppData/Local/Programs/Python/Python311/Lib/site-packages/pymupdf/__init__.py:44) #
[46](file:///C:/Users/thiag/AppData/Local/Programs/Python/Python311/Lib/site-packages/pymupdf/__init__.py:46) def _set_stream(name, default):
...
---> [10](file:///C:/Users/thiag/AppData/Local/Programs/Python/Python311/Lib/site-packages/pymupdf/extra.py:10) from . import _extra
[11](file:///C:/Users/thiag/AppData/Local/Programs/Python/Python311/Lib/site-packages/pymupdf/extra.py:11) else:
[12](file:///C:/Users/thiag/AppData/Local/Programs/Python/Python311/Lib/site-packages/pymupdf/extra.py: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
There it was mentioned that installing pymupdf==1.24.9
could solve it.
But still I’d love to figure out the root cause…
Leo
(Leo Romero)
5 February 2025 14:26
10
Running pip pymupdf==1.24.9
the same error: No keyword with name ‘Compare Images’ found.
Leo
(Leo Romero)
5 February 2025 14:30
11
I’m going to try using python 3.11
Many
(Many Kasiriha)
5 February 2025 14:40
12
It should work with Python 3.12 as well.
I have the strong feeling that it is caused by a missing Visual C++ Redistributable package.
Below you can find a screenshot from my machine.
Maybe you can compare with your Windows 11 machine where it is working.
Many
(Many Kasiriha)
5 February 2025 14:43
13
Here it is definitely the same problem reported at PyMuPDF
opened 07:03AM - 20 Sep 23 UTC
closed 01:38AM - 22 Sep 23 UTC
system:Windows 10 64
python:Python 3.10.11 amd64
pypdf:1.23.3
after use pip… install PyMuPdf,get error
Type "help", "copyright", "credits" or "license" for more information.
>>> import fitz
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\yuc\AppData\Local\Programs\Python\Python310\lib\site-packages\fitz\__init__.py", line 22, in <module>
from fitz.fitz import *
File "C:\Users\yuc\AppData\Local\Programs\Python\Python310\lib\site-packages\fitz\fitz.py", line 14, in <module>
from . import _fitz
ImportError: DLL load failed while importing _fitz: 找不到指定的模块。
2 Likes
I have just recently discovered that when installing Python from Microsoft Store, the Visual C++ library is missing.
(Here is my video about the installation of RIDE where I have found that problem. )
1 Like
Leo
(Leo Romero)
5 February 2025 16:51
15
I installed Visual C++ Redistributable package x86 and x64.
Then I uninstalled everything with: pip freeze > out.txt
pip uninstall -r out.txt -y
and then reinstalled everything again
robotframework==7.2
robotframework-doctestlibrary==0.23.0
pyautogui==0.9.54
pywinauto==0.6.9
and it worked!!!
thanks for the help!
2 Likes