小编Bak*_*ker的帖子

引发 RuntimeError(f"目录 '{directory}' 不存在") RuntimeError: 导入 fitz 时目录 'static/' 不存在

当我运行 extract_img.py 文件时出现此错误:

\n
\n

运行时错误(f\xe2\x80\x9c目录'{目录}'不存在\xe2\x80\x9d)
\n运行时错误:导入fitz时目录'static/'不存在

\n
\n

我不明白为什么这会向我发回此错误消息。\n我之前看到过处理此主题的对话,但我不明白解决方案。你可以帮帮我吗?

\n

此文件旨在从 PDF 文件中提取某些图像(某些文件中的图像)。

\n
from os import chdir\nimport shutil, os\nimport io\nfrom PIL import Image\nimport fitz\nfrom unif_noun import unif_noun #other file python for change file noun.\n\ndef execute_func(rootdir):\nfor subdir, dirs, files in os.walk(rootdir):\n    for file in files:\n        filepath = subdir + os.sep + file\n        if filepath.endswith(".pdf"):\n            #extract(f"{filepath}")\n            # open the file\n            pdf_file = fitz.open(file)\n            images = list()\n            for page_index in range(len(pdf_file)):\n                # get the page itself\n                page = pdf_file[page_index]\n                image_list = …
Run Code Online (Sandbox Code Playgroud)

python

21
推荐指数
2
解决办法
3万
查看次数

标签 统计

python ×1