项目场景:

使用源码报错


问题描述

  File "/home/cbb/bin/caj2pdf-master/caj2pdf", line 5, in <module>
    from cajparser import CAJParser
  File "/home/cbb/bin/caj2pdf-master/cajparser.py", line 5, in <module>
    from utils import fnd, fnd_all, add_outlines, fnd_rvrs, fnd_unuse_no
  File "/home/cbb/bin/caj2pdf-master/utils.py", line 3, in <module>
    import PyPDF2.generic as PDF
  File "/home/cbb/bin/caj2pdf-master/PyPDF2/__init__.py", line 10, in <module>
    from ._merger import PdfFileMerger, PdfMerger
  File "/home/cbb/bin/caj2pdf-master/PyPDF2/_merger.py", line 31, in <module>
    from ._encryption import Encryption
  File "/home/cbb/bin/caj2pdf-master/PyPDF2/_encryption.py", line 34, in <module>
    from PyPDF2.generic import (
  File "/home/cbb/bin/caj2pdf-master/PyPDF2/generic.py", line 48, in <module>
    from ._utils import (
  File "/home/cbb/bin/caj2pdf-master/PyPDF2/_utils.py", line 50, in <module>
    from typing_extensions import TypeAlias  # type: ignore[misc]
ModuleNotFoundError: No module named 'typing_extensions'

原因分析:

缺少 python 第三方包 typing_extensions


解决方案:

直接安装就好

pip install typing_extensions
Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐