Closed yuchangfu closed 1 year ago
Thanks for reporting this.
[According to Google, 找不到指定的模块。
translates to Can't find the specified module.
]
I've just checked and things work fine for me on Windows, so i'm not sure what's going wrong for you here.
pip show pymupdf
.pip show pymupdfb
.I changed Python version to 3.10.7 ,this version work fine on my other computer,but on this computer the error are same.
C:\Users\yuc>pip install pymupdf --no-cache-dir Defaulting to user installation because normal site-packages is not writeable Collecting pymupdf Obtaining dependency information for pymupdf from https://files.pythonhosted.org/packages/de/ff/0c16387c329023ab76d860329202a6c1b9c59291adfa4869f0fe16659646/PyMuPDF-1.23.3-cp310-none-win_amd64.whl.metadata Downloading PyMuPDF-1.23.3-cp310-none-win_amd64.whl.metadata (3.4 kB) Requirement already satisfied: PyMuPDFb==1.23.3 in c:\users\yuc\appdata\roaming\python\python310\site-packages (from pymupdf) (1.23.3) Downloading PyMuPDF-1.23.3-cp310-none-win_amd64.whl (3.5 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.5/3.5 MB 23.4 kB/s eta 0:00:00 Installing collected packages: pymupdf Successfully installed pymupdf-1.23.3
After install I test it,get this
`
C:\Users\yuc>python
Python 3.10.7 (tags/v3.10.7:6cc6b13, Sep 5 2022, 14:08:36) [MSC v.1933 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
import fitz Traceback (most recent call last): File "
", line 1, in File "C:\Users\yuc\AppData\Roaming\Python\Python310\site-packages\fitz__init__.py", line 22, in from fitz.fitz import * File "C:\Users\yuc\AppData\Roaming\Python\Python310\site-packages\fitz\fitz.py", line 14, in from . import _fitz ImportError: DLL load failed while importing _fitz: 找不到指定的模块。 `
3.pip show pymupdf ` C:\Users\yuc>pip show pymupdf Name: PyMuPDF Version: 1.23.3 Summary: A high performance Python library for data extraction, analysis, conversion & manipulation of PDF (and other) documents. Home-page: Author: Artifex Author-email: support@artifex.com License: GNU AFFERO GPL 3.0 Location: c:\users\yuc\appdata\roaming\python\python310\site-packages Requires: PyMuPDFb Required-by:
4.pip show pymupdfb
C:\Users\yuc>pip show pymupdfb
Name: PyMuPDFb
Version: 1.23.3
Summary: MuPDF shared libraries for PyMuPDF.
Home-page:
Author: Artifex
Author-email: support@artifex.com
License: GNU AFFERO GPL 3.0
Location: c:\users\yuc\appdata\roaming\python\python310\site-packages
Requires:
Required-by: PyMuPDF
`
Thank you
Thanks for the comprehensive answers to my questions.
dir c:\users\yuc\appdata\roaming\python\python310\site-packages\fitz
dir c:\users\yuc\appdata\roaming\python\python310\site-packages\fitz_new
Finally i wonder whether you could try installing into a venv, by running these commands:
py -m venv pylocal
pylocal\Scripts\activate
python -m pip install --upgrade pip
pip install pymupdf
[Hopefully we'll be able to get your non-venv approach to work, but knowing whether a venv works will be useful information.]
Thank you,Problem solved. The resion is my system missing MSVCP140.dll.If you have problem like this.the following is for reference: 1.use dll-diagnostics to check DLL dependencies
C:\Users\yuc\AppData\Roaming\Python\Python310\site-packages\fitz>dlldiag deps mupdfcpp64.dll DLL Diagnostic Tools version 0.0.18 Copyright (c) 2019-2021 Adam Rehn
Parsing module header and identifying direct dependencies... done.
Parsed module details: Module: C:\Users\yuc\AppData\Roaming\Python\Python310\site-packages\fitz\mupdfcpp64.dll Type: Dynamic-Link Library Architecture: x64
Attempting to load the module's direct dependencies:
api-ms-win-crt-convert-l1-1-0.dll Loaded successfully api-ms-win-crt-environment-l1-1-0.dll Loaded successfully api-ms-win-crt-filesystem-l1-1-0.dll Loaded successfully api-ms-win-crt-heap-l1-1-0.dll Loaded successfully api-ms-win-crt-math-l1-1-0.dll Loaded successfully api-ms-win-crt-runtime-l1-1-0.dll Loaded successfully api-ms-win-crt-stdio-l1-1-0.dll Loaded successfully api-ms-win-crt-string-l1-1-0.dll Loaded successfully api-ms-win-crt-time-l1-1-0.dll Loaded successfully api-ms-win-crt-utility-l1-1-0.dll Loaded successfully KERNEL32.dll Loaded successfully MSVCP140.dll Error 126: 找不到指定的模块。 VCRUNTIME140.dll Loaded successfully VCRUNTIME140_1.dll Loaded successfully
Why test dependencies of mupdfcpp64.dll ,because it's the only one DLL file in fitz
C:\Users\yuc>cd "C:\Users\yuc\AppData\Roaming\Python\Python310\site-packages\fitz
C:\Users\yuc\AppData\Roaming\Python\Python310\site-packages\fitz>dir 驱动器 C 中的卷没有标签。 卷的序列号是 0E51-A8A2
C:\Users\yuc\AppData\Roaming\Python\Python310\site-packages\fitz 的目录
2023/09/21 09:20
. 2023/09/22 09:10 .. 2023/09/21 08:23 377,637 fitz.py 2023/09/21 08:11 23,288,832 mupdfcpp64.dll 2023/09/21 08:23 75,219 table.py 2023/09/21 08:23 187,581 utils.py 2023/09/21 08:23 716,288 _fitz.cp310-win_amd64.pyd 2023/09/21 08:23 22,932 init.py 2023/09/21 08:23 40,875 main.py 2023/09/21 08:23 pycache
Great, i'm glad you were able to fix the problem.
And many thanks for the detailed explanation, it's really appreciated. I haven't come across dll-diagnostics before, it looks very useful.
I can confirm I had the exact same issue on a windows 10 VM that was previously working. I didn't experience this problem on another laptop.
Replaced the missing MSVCP140.dll in C:\Windows\System32 folder and everything now works again. Thanks for the fix.
Good to know.
I've just added a note about this issue to docs/installation.rst
. This will be visible in the official docs after the next release.
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.