PyInstaller 错误:pythoncom 模块出现 AttributeError

问题描述 投票:0回答:1

我在尝试使用 PyInstaller 为我的 Python 应用程序创建 .exe 文件时遇到错误。运行

pyinstaller --onefile -w my_script.py
时,我始终收到以下错误:

AttributeError: Failed to retrieve attribute __file__ from module pythoncom

这是我在脚本中使用的包:

from fpdf import FPDF
from PIL import Image
import os
import tkinter as tk
from tkinter import filedialog, Label, messagebox
from tkinter import ttk
import time

尽管研究了几个小时的在线解决方案,但我还没有找到任何有效的解决方案。感谢有关解决此问题的任何指导。谢谢!

python pyinstaller
1个回答
0
投票

该错误可能与 pywin32 和 PyInstaller 使用的 pythoncom 模块的兼容性问题有关。

© www.soinside.com 2019 - 2024. All rights reserved.