File "C:\ProgramData\Anaconda3\envs\ clonebasic\lib\site-packages\PyInstaller\hooks\hook-PyQt5.py", строка 12, в
из PyInstaller.utils.hooks.qt импортирует get_qt_binaries, pyqt5_library_info
Ошибка импорта: невозможно импортировать имя «get_qt_binaries» из «PyInstaller.utils.hooks.qt» (C:\ProgramData\Anaconda3\envs\clonebasic\lib\site-packages\PyInstaller\utils\hooks\qt_init_.py)
Во время обработки из вышеуказанного исключения произошло другое исключение:
Traceback (последний вызов):
File "C:\ProgramData\Anaconda3\envs\clonebasic\Scripts\pyinstaller-script.py", строка 10, в
sys.exit(run())
файле "C:\ProgramData\Anaconda3\ envs\clonebasic\lib\site-packages\PyInstaller_main_.py", строка 179, в запуске
run_build(pyi_config, spec_file, **vars(args))
Файл "C:\ProgramData\Anaconda3\envs\clonebasic\lib\site-packages\PyInstaller_main_.py ", строка 60, в run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
Файл «C:\ProgramData\Anaconda3\envs\clonebasic\lib\site-packages\PyInstaller\building\build_main.py», строка 963, в основной
build(specfile, distpath) , рабочий путь, clean_build)
Файл "C:\ProgramData\Anaconda3\envs\clonebasic\lib\site-packages\PyInstaller\building\build_main.py", строка 885, в build
exec(code, spec_namespace)
Файл "H: \report_anaлиз\report_anaлиз\main.spec", строка 7, в
a = Analysis(
File "C:\ProgramData\Anaconda3\envs\clonebasic\lib\site-packages\PyInstaller\building\build_main.py", строка 410, в init
self.postinit< /strong>()
Файл «C:\ProgramData\Anaconda3\envs\clonebasic\lib\site-packages\PyInstaller\building\datastruct.py», строка 173, в postinit
self.assemble()
Файл "C:\ProgramData\Anaconda3\envs\clonebasic\lib\site-packages\PyInstaller\building\build_main.py", строка 579, в файле assemble
self.graph.process_post_graph_hooks(self)
«C:\ProgramData\Anaconda3\envs\clonebasic\lib\site-packages\PyInstaller\dependent\anasis.py», строка 329, в файлеprocess_post_graph_hooks
module_hook.post_graph(anaанализ)
Файл «C:\ProgramData\Anaconda3\envs\clonebasic\lib\site-packages\PyInstaller\dependent\imphook.py», строка 447, в post_graph
self._load_hook_module(keep_module_ref=True)
Файл "C:\ProgramData\Anaconda3\envs\clonebasic\lib\site-packages\PyInstaller\dependent\imphook.py", строка 390, в _load_hook_module
raise ImportErrorWhenRunningHook(self.hook_module_name, self.hook_filename)
PyInstaller.Exceptions.ImportErrorWhenRunningHook: не удалось импортировать модуль __PyInstaller_hooks_0_PyQt5, необходимый для перехватчика для модуля C:\ProgramData\Anaconda3\envs\clonebasic\lib\site-packages\PyInstaller\hooks\hook-PyQt5.py. Пожалуйста, проверьте, действительно ли существует модуль __PyInstaller_hooks_0_PyQt5 и совместим ли он с вашей версией C:\ProgramData\Anaconda3\envs\clonebasic\lib\site-packages\PyInstaller\hooks\hook-PyQt5.py: Возможно, вы захотите узнать больше о хуках в руководстве и предоставьте запрос на улучшение PyInstaller.
Я не программист Python и унаследовал этот проект. Я понятия не имею, как действовать дальше. Кто-нибудь знаком с этой проблемой?
Основываясь на других поисковых запросах на этом сайте/в Интернете, я попытался добавить дополнительный крючок:
Код: Выделить всё
from PyInstaller.utils.hooks import qt_plugins_binaries
# Fixed the issue: could not find or load the Qt platform plugin "windows".
binaries = qt_plugins_binaries('platforms', 'PyQt5')
Обновлено Pandas на основе этого ответа: ImportErrorWhenRunningHook: pyinstaller не удалось импортировать модуль _pyinstaller_hooks_0_pandas_io_formats_style, необходимый для модуля
Но без прогресса.
Я запускаю это с помощью pyinstaller --onefile --debug=all main.py
Минимально воспроизводимый пример:
Main.py
Код: Выделить всё
import sys
import os
from gui import Window
def api():
w = Window()
w.window.mainloop()
if __name__ == '__main__':
api()
Код: Выделить всё
"""This is the GUI object"""
from tkinter import Tk, Label, Button, Entry, filedialog, HORIZONTAL
from tkinter.ttk import Progressbar
from threading import Thread
from re import sub
from pandas import read_excel, DataFrame
class Window():
def __init__(self):
self.window = Tk()
self.window.title('Report Analysis')
self.window.geometry("480x640")
self.window.config(background='white')
self.widgets = []
for text in ['Select a File', 'Sheet name', 'Select an Output Directory']:
self.widgets.append(self.CreateLabel(text))
self.widgets.insert(1, self.CreateButton('Browse Files', self.BrowseFiles))
self.widgets.insert(3, Entry(self.window, bd=3, width=18))
self.widgets.insert(5, self.CreateButton('Browse Directories', self.BrowseDirs))
self.widgets.append(Label(self.window, text='', bg='white'))
self.widgets.append(Button(self.window, text='Submit', command=self.Submit))
for widget in self.widgets:
index = self.widgets.index(widget)
pady = ((index + 1) % 2 * 20, (index + 1) % 2 * 5)
widget.grid(column=0, row=index, padx=50, pady=pady)
self.progress = Progressbar(self.window, orient=HORIZONTAL, length=200, mode='indeterminate')
def CreateLabel(self, text):
return Label(self.window, text=text, width=50, height=2, fg='blue')
def CreateButton(self, text, command):
return Button(self.window, text=text, command=command, bd=3, width=18)
def BrowseFiles(self):
pass
def BrowseDirs(self):
pass
def Submit(self):
pass
def ErrorHandling(self, import_file, sheet_name, output_path):
if import_file == 'Select a File':
raise Exception('No file selected.')
if sheet_name.strip() == '':
raise Exception('No sheet name entered.')
if output_path == 'Select an Output Directory':
raise Exception('No directory selected.')
Подробнее здесь: https://stackoverflow.com/questions/774 ... ort-module
Мобильная версия