Я пытаюсь создать приложение с графическим интерфейсом, используя cx_Freeze
. setup.py
выглядит следующим образом:
from cx_Freeze import setup, Executable
import os
import sys
base = None
if sys.platform == 'win32':
base = 'Win32GUI'
exe = [Executable("main.py", base=base, icon='window_icon_XbH_icon.ico')]
os.environ['TCL_LIBRARY'] = r'C:\\Users\\dm\\AppData\\Local\\Programs\\Python\\Python36\\tcl\\tcl8.6'
os.environ['TK_LIBRARY'] = r'C:\\Users\\dm\\AppData\\Local\\Programs\\Python\\Python36\\tcl\\tk8.6'
options = {
'build_exe': {
'includes': ['scipy.io', 'scipy.spatial.ckdtree'],
'include_files': [r'C:\\Users\\dm\\AppData\\Local\\Programs\\Python\\Python36\\DLLs\\tcl86t.dll', r'C:\\Users\\dm\\AppData\\Local\\Programs\\Python\\Python36\\DLLs\\tk86t.dll',
r'C:\\Users\\dm\\AppData\\Local\\Programs\\Python\\Python36\\Lib\\site-packages\\pyqt5_tools\\platforms\\qwindows.dll', 'window_icon_XbH_icon.ico'],
'packages': ['pkg_resources._vendor', 'pandas', 'numpy', 'scipy', 'pydub', 'PyQt5', 'soundfile', 'sounddevice', 'cffi'],
}
}
setup(name="app", version="1.0", description='To be added',
options=options, executables=exe)
При сборке cx_Freeze вызывает следующую ошибку. Я установил PyQt5.
running build
running build_exe
Traceback (most recent call last):
File "setup.py", line 38, in <module>
options=options, executables=exe)
File "C:\Users\dm\AppData\Local\Programs\Python\Python36\lib\site-packages\cx_Freeze\dist.py", line 349, in setup
distutils.core.setup(**attrs)
File "C:\Users\dm\AppData\Local\Programs\Python\Python36\lib\distutils\core.py", line 148, in setup
dist.run_commands()
File "C:\Users\dm\AppData\Local\Programs\Python\Python36\lib\distutils\dist.py", line 955, in run_commands
self.run_command(cmd)
File "C:\Users\dm\AppData\Local\Programs\Python\Python36\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\dm\AppData\Local\Programs\Python\Python36\lib\distutils\command\build.py", line 135, in run
self.run_command(cmd_name)
File "C:\Users\dm\AppData\Local\Programs\Python\Python36\lib\distutils\cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "C:\Users\dm\AppData\Local\Programs\Python\Python36\lib\distutils\dist.py", line 974, in run_command
cmd_obj.run()
File "C:\Users\dm\AppData\Local\Programs\Python\Python36\lib\site-packages\cx_Freeze\dist.py", line 219, in run
freezer.Freeze()
File "C:\Users\dm\AppData\Local\Programs\Python\Python36\lib\site-packages\cx_Freeze\freezer.py", line 616, in Freeze
self.finder = self._GetModuleFinder()
File "C:\Users\dm\AppData\Local\Programs\Python\Python36\lib\site-packages\cx_Freeze\freezer.py", line 342, in _GetModuleFinder
finder.IncludePackage(name)
File "C:\Users\dm\AppData\Local\Programs\Python\Python36\lib\site-packages\cx_Freeze\finder.py", line 659, in IncludePackage
module = self._ImportModule(name, deferredImports)
File "C:\Users\dm\AppData\Local\Programs\Python\Python36\lib\site-packages\cx_Freeze\finder.py", line 351, in _ImportModule
raise ImportError("No module named %r" % name)
ImportError: No module named 'PyQt5.Qt'
Может ли кто-нибудь помочь мне понять, что на самом деле идет не так?