Open Andy-AO opened 1 day ago
建议重装一下
楼上的解决方案应该可以帮助解决该问题,暂时关闭 issue。
楼上的解决方案应该可以帮助解决该问题,暂时关闭 issue。
重装之后,该问题重现
(pdf2zh_ri) D:\software\green\pdf2zh_ri> pdf2zh document.pdf
Traceback (most recent call last):
File "C:\Users\Andy\.pyenv\pyenv-win\versions\3.9.0\lib\runpy.py", line 197, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\Andy\.pyenv\pyenv-win\versions\3.9.0\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "D:\software\green\pdf2zh_ri\Scripts\pdf2zh.exe\__main__.py", line 7, in <module>
sys.exit(main())
File "d:\software\green\pdf2zh_ri\lib\site-packages\pdf2zh\pdf2zh.py", line 262, in main
extract_text(**vars(parsed_args))
File "d:\software\green\pdf2zh_ri\lib\site-packages\pdf2zh\pdf2zh.py", line 72, in extract_text
import pdf2zh.high_level
File "d:\software\green\pdf2zh_ri\lib\site-packages\pdf2zh\high_level.py", line 12, in <module>
from pdf2zh.converter import (
File "d:\software\green\pdf2zh_ri\lib\site-packages\pdf2zh\converter.py", line 35, in <module>
from pdf2zh.image import ImageWriter
File "d:\software\green\pdf2zh_ri\lib\site-packages\pdf2zh\image.py", line 14, in <module>
from pdf2zh.layout import LTImage
File "d:\software\green\pdf2zh_ri\lib\site-packages\pdf2zh\layout.py", line 21, in <module>
from pdf2zh.pdfinterp import Color, PDFGraphicState
File "d:\software\green\pdf2zh_ri\lib\site-packages\pdf2zh\pdfinterp.py", line 11, in <module>
from pdf2zh.pdfdevice import PDFDevice, PDFTextSeq
File "d:\software\green\pdf2zh_ri\lib\site-packages\pdf2zh\pdfdevice.py", line 15, in <module>
from pdf2zh.pdfpage import PDFPage
File "d:\software\green\pdf2zh_ri\lib\site-packages\pdf2zh\pdfpage.py", line 6, in <module>
from pdf2zh.pdfdocument import (
File "d:\software\green\pdf2zh_ri\lib\site-packages\pdf2zh\pdfdocument.py", line 23, in <module>
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
File "d:\software\green\pdf2zh_ri\lib\site-packages\cryptography\hazmat\primitives\ciphers\__init__.py", line 11, in <module>
from cryptography.hazmat.primitives.ciphers.base import (
File "d:\software\green\pdf2zh_ri\lib\site-packages\cryptography\hazmat\primitives\ciphers\base.py", line 10, in <module>
from cryptography.hazmat.bindings._rust import openssl as rust_openssl
ImportError: DLL load failed while importing _rust: The specified procedure could not be found.
(pdf2zh_ri) D:\software\green\pdf2zh_ri>
楼上的解决方案应该可以帮助解决该问题,暂时关闭 issue。
重装之后,该问题重现
(pdf2zh_ri) D:\software\green\pdf2zh_ri> pdf2zh document.pdf Traceback (most recent call last): File "C:\Users\Andy\.pyenv\pyenv-win\versions\3.9.0\lib\runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\Andy\.pyenv\pyenv-win\versions\3.9.0\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "D:\software\green\pdf2zh_ri\Scripts\pdf2zh.exe\__main__.py", line 7, in <module> sys.exit(main()) File "d:\software\green\pdf2zh_ri\lib\site-packages\pdf2zh\pdf2zh.py", line 262, in main extract_text(**vars(parsed_args)) File "d:\software\green\pdf2zh_ri\lib\site-packages\pdf2zh\pdf2zh.py", line 72, in extract_text import pdf2zh.high_level File "d:\software\green\pdf2zh_ri\lib\site-packages\pdf2zh\high_level.py", line 12, in <module> from pdf2zh.converter import ( File "d:\software\green\pdf2zh_ri\lib\site-packages\pdf2zh\converter.py", line 35, in <module> from pdf2zh.image import ImageWriter File "d:\software\green\pdf2zh_ri\lib\site-packages\pdf2zh\image.py", line 14, in <module> from pdf2zh.layout import LTImage File "d:\software\green\pdf2zh_ri\lib\site-packages\pdf2zh\layout.py", line 21, in <module> from pdf2zh.pdfinterp import Color, PDFGraphicState File "d:\software\green\pdf2zh_ri\lib\site-packages\pdf2zh\pdfinterp.py", line 11, in <module> from pdf2zh.pdfdevice import PDFDevice, PDFTextSeq File "d:\software\green\pdf2zh_ri\lib\site-packages\pdf2zh\pdfdevice.py", line 15, in <module> from pdf2zh.pdfpage import PDFPage File "d:\software\green\pdf2zh_ri\lib\site-packages\pdf2zh\pdfpage.py", line 6, in <module> from pdf2zh.pdfdocument import ( File "d:\software\green\pdf2zh_ri\lib\site-packages\pdf2zh\pdfdocument.py", line 23, in <module> from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes File "d:\software\green\pdf2zh_ri\lib\site-packages\cryptography\hazmat\primitives\ciphers\__init__.py", line 11, in <module> from cryptography.hazmat.primitives.ciphers.base import ( File "d:\software\green\pdf2zh_ri\lib\site-packages\cryptography\hazmat\primitives\ciphers\base.py", line 10, in <module> from cryptography.hazmat.bindings._rust import openssl as rust_openssl ImportError: DLL load failed while importing _rust: The specified procedure could not be found. (pdf2zh_ri) D:\software\green\pdf2zh_ri>
您好能不能给一个 conda 环境的 yml? 我试试
楼上的解决方案应该可以帮助解决该问题,暂时关闭 issue。
重装之后,该问题重现
(pdf2zh_ri) D:\software\green\pdf2zh_ri> pdf2zh document.pdf Traceback (most recent call last): File "C:\Users\Andy\.pyenv\pyenv-win\versions\3.9.0\lib\runpy.py", line 197, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\Andy\.pyenv\pyenv-win\versions\3.9.0\lib\runpy.py", line 87, in _run_code exec(code, run_globals) File "D:\software\green\pdf2zh_ri\Scripts\pdf2zh.exe\__main__.py", line 7, in <module> sys.exit(main()) File "d:\software\green\pdf2zh_ri\lib\site-packages\pdf2zh\pdf2zh.py", line 262, in main extract_text(**vars(parsed_args)) File "d:\software\green\pdf2zh_ri\lib\site-packages\pdf2zh\pdf2zh.py", line 72, in extract_text import pdf2zh.high_level File "d:\software\green\pdf2zh_ri\lib\site-packages\pdf2zh\high_level.py", line 12, in <module> from pdf2zh.converter import ( File "d:\software\green\pdf2zh_ri\lib\site-packages\pdf2zh\converter.py", line 35, in <module> from pdf2zh.image import ImageWriter File "d:\software\green\pdf2zh_ri\lib\site-packages\pdf2zh\image.py", line 14, in <module> from pdf2zh.layout import LTImage File "d:\software\green\pdf2zh_ri\lib\site-packages\pdf2zh\layout.py", line 21, in <module> from pdf2zh.pdfinterp import Color, PDFGraphicState File "d:\software\green\pdf2zh_ri\lib\site-packages\pdf2zh\pdfinterp.py", line 11, in <module> from pdf2zh.pdfdevice import PDFDevice, PDFTextSeq File "d:\software\green\pdf2zh_ri\lib\site-packages\pdf2zh\pdfdevice.py", line 15, in <module> from pdf2zh.pdfpage import PDFPage File "d:\software\green\pdf2zh_ri\lib\site-packages\pdf2zh\pdfpage.py", line 6, in <module> from pdf2zh.pdfdocument import ( File "d:\software\green\pdf2zh_ri\lib\site-packages\pdf2zh\pdfdocument.py", line 23, in <module> from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes File "d:\software\green\pdf2zh_ri\lib\site-packages\cryptography\hazmat\primitives\ciphers\__init__.py", line 11, in <module> from cryptography.hazmat.primitives.ciphers.base import ( File "d:\software\green\pdf2zh_ri\lib\site-packages\cryptography\hazmat\primitives\ciphers\base.py", line 10, in <module> from cryptography.hazmat.bindings._rust import openssl as rust_openssl ImportError: DLL load failed while importing _rust: The specified procedure could not be found. (pdf2zh_ri) D:\software\green\pdf2zh_ri>
您好能不能给一个 conda 环境的 yml? 我试试
我是这样用的,注意Python版本3.9.0,平台Windows10
python -m venv .
.\Scripts\Activate.ps1
pip install pdf2zh
pdf2zh document.pdf
刚刚发现用pyenv local 3.11.5
更换版本后这个问题消除(还有其他问题,也不能正常用),所以版本3.9.0
应该是必要条件。
似乎是加密包的版本问题,这里提供了解决方案 https://forum.rasa.com/t/from-cryptography-hazmat-bindings-rust-import-importerror-dll-load-failed-while-importing-rust-the-specified-procedure-could-not-be-found/60963/1
等待 windows 机器复现后,看看 setup.py 要不要指定最低的加密包版本。
问题描述
执行 pdf2zh document.pdf 出现
ImportError: DLL load failed while importing _rust: The specified procedure could not be found.
python --version Python 3.9.0
测试文档
document.pdf