通过Auto-Py-Exe生成EXE后使用Aspose字的问题

发布于 2025-02-08 08:15:53 字数 1232 浏览 1 评论 0原文

  1. 嗨,我想我迷路了。有帮助吗?我需要创建一个可执行的 使用我的Python代码文件时,当我运行文件时,请给出以下错误。 谢谢我所有的代码:


     导入aspose.words as aw namepdf ='nf-teste.pdf'doc =
    aw.document(namepdf)nametxt = namepdf.strip('。pdf')
    doc.save(nametxt +“ .txt”)
     

    然后,我使用自动py-to-exe生成.EXE。我执行EXE文件 创建然后给我错误:

     文件“<冻结
    empertlib._bootstrap>“,第1027行,in _find_and_load文件”< frozen
    Empertlib._bootstrap>“,第1006行,在_find_and_load_unlocked文件中
    “< frozen expitionlib._bootstrap>”,第672行,在_load_unlocked文件中
    “< frozen Expitionlib._bootstrap>”,第640行,in
    _load_backward_compatible keyError:'aspose.pygc'
    上述例外是以下例外的直接原因:
    Infrorror:加载模块时发生一个或多个错误
    'Aspose.pygc'(-2)上述例外是直接原因
    以下例外:trackback(最近的最新通话):文件
    “ aspose \ __ init__.py”,第44行,在load_module文件中
    “ aspose \ __ init__.py”,第76行,在_load_native_module inderterror中:
    加载模块时发生一个或多个错误
    “ aspose.pydrawing'(-1)上述例外是直接原因
    以下例外:Importerror:发生一个或多个错误
    加载模块时“ aspose.pydrawing”(--2)上述例外
    是以下例外的直接原因:trackback(大多数
    最近的电话):文件“ pdfttttest.py”,第14行,in< module>
        导入Aspose.Words作为AW文件“ Aspose \ __ Init__.py”,第44行,load_module file中的“ Aspose \ __ init__.py”,第76行,in
    _load_native_module Importerror:加载模块'aspose.words'(-1)[5988]未能执行一个或多个错误
    脚本“ pdftxttest”由于未经治疗的例外!
     

  1. Hi, I think I am lost. Any help? I need to create an executable
    file with my python code, when I run the file give the errors below.
    Thank you all My code:


    import aspose.words as aw namePDF = 'NF-TESTE.pdf' doc =
    aw.Document(namePDF) nameTXT = namePDF.strip('.pdf')
    doc.save(nameTXT + ".txt")
    

    Then I generate an .exe using auto-py-to-exe. I execute the EXE file
    created and then give me the error:

    File "<frozen
    importlib._bootstrap>", line 1027, in _find_and_load   File "<frozen
    importlib._bootstrap>", line 1006, in _find_and_load_unlocked   File
    "<frozen importlib._bootstrap>", line 672, in _load_unlocked   File
    "<frozen importlib._bootstrap>", line 640, in
    _load_backward_compatible KeyError: 'aspose.pygc'
    The above exception was the direct cause of the following exception:
    ImportError: One or more errors occurred while loading the module
    'aspose.pygc' (-2) The above exception was the direct cause of the
    following exception: Traceback (most recent call last):   File
    "aspose\__init__.py", line 44, in load_module   File
    "aspose\__init__.py", line 76, in _load_native_module ImportError:
    One or more errors occurred while loading the module
    'aspose.pydrawing' (-1) The above exception was the direct cause of
    the following exception: ImportError: One or more errors occurred
    while loading the module 'aspose.pydrawing' (-2) The above exception
    was the direct cause of the following exception: Traceback (most
    recent call last):   File "pdfTXTTest.py", line 14, in <module>
        import aspose.words as aw   File "aspose\__init__.py", line 44, in load_module   File "aspose\__init__.py", line 76, in
    _load_native_module ImportError: One or more errors occurred while loading the module 'aspose.words' (-1) [5988] Failed to execute
    script 'pdfTXTTest' due to unhandled exception!
    

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

慢慢从新开始 2025-02-15 08:15:53

Aspose字软件包是Python二进制扩展。默认情况下,二进制依赖项不会通过pyinstallerauto-py-to-to-exe)复制到输出目录。因此,您应该明确为二进制文件指定一些其他选项。

这些选项应有所帮助:

--collect-binaries "aspose" --collect-submodules "aspose"

aspose-words package is a Python binary extensions. By default, binary dependencies are not copied to the output directory by the PyInstaller (auto-py-to-exe). Therefore, you should explicitly specify some additional options for binary files.

These options should help:

--collect-binaries "aspose" --collect-submodules "aspose"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文