我正在尝试为我的小应用程序创建一个设置。使用 pyinstaller 创建后.exe (--onedir)
(它可以工作)。
我使用 InnoSetup 创建安装文件。之后,我安装了该应用程序,然后启动它。但随后出现了一个问题:
我的项目中没有使用 importlib 模块,但我尝试在文件中隐藏导入.spec
。存在错误。
我的项目和我写的一样小,它使用 pyqt5、multiprocessing、pyaudio、pydub 作为主要模块。
有人能帮帮我吗?
如果我简单地将 dist 文件夹(由 PyInstaller 创建)复制到 C:/Program Files/,该项目就可以运行。
编辑:我重新制作了 inno 安装文件。首先,我包含 EXE 文件夹,其中包含:a)pycache文件夹 b) dist 文件夹 c) build 文件夹和 d) .ico 文件。然后我包含文件夹 EXE/dist/epalxeis-main,epalxeis-main 是由 pyinstaller 创建的文件夹,包含所有必要的文件。最后我包含 dist/epalxeis-main 文件夹中除 epalxeis-main.exe 之外的所有文件。创建安装文件并安装应用程序后,应用程序运行。
没有错误,但应用程序没有按照我的预期运行。ui 已显示,我可以与 ui 交互,但程序的 pyqt5-QThread、multiproccesing-Process 部分可能在某些地方滞后。
我希望这里有一个在线广播流媒体服务。
我尝试使用不带 --windowed 标志的 pyinstaller。
innosetup安装后的控制台是:
import 'multiprocessing.context' # <_frozen_importlib_external.SourcelessFileLoa
der object at 0x0000000002C7C240>
import 'multiprocessing' # <_frozen_importlib_external.SourcelessFileLoader obje
ct at 0x0000000002C7C048>
# multiprocessing.spawn not found in PYZ
# code object from 'C:\\Program Files (x86)\\Epalxeis Radio Player\\multiprocess
ing\\spawn.pyc'
# runpy not found in PYZ
# code object from 'C:\\Program Files (x86)\\Epalxeis Radio Player\\runpy.pyc'
import 'runpy' # <_frozen_importlib_external.SourcelessFileLoader object at 0x00
00000002CB9AC8>
# multiprocessing.util not found in PYZ
# code object from 'C:\\Program Files (x86)\\Epalxeis Radio Player\\multiprocess
ing\\util.pyc'
import 'atexit' # <class '_frozen_importlib.BuiltinImporter'>
# subprocess not found in PYZ
# code object from 'C:\\Program Files (x86)\\Epalxeis Radio Player\\subprocess.p
yc'
import 'msvcrt' # <class '_frozen_importlib.BuiltinImporter'>
import 'subprocess' # <_frozen_importlib_external.SourcelessFileLoader object at
0x0000000002CF5780>
import 'multiprocessing.util' # <_frozen_importlib_external.SourcelessFileLoader
object at 0x0000000002CCCDD8>
import 'multiprocessing.spawn' # <_frozen_importlib_external.SourcelessFileLoade
r object at 0x0000000002C7C0B8>
# multiprocessing.popen_spawn_win32 not found in PYZ
# code object from 'C:\\Program Files (x86)\\Epalxeis Radio Player\\multiprocess
ing\\popen_spawn_win32.pyc'
import 'multiprocessing.popen_spawn_win32' # <_frozen_importlib_external.Sourcel
essFileLoader object at 0x0000000002CD5D68>
[2216] LOADER: Running pyi_rth_pyqt5.py
[2216] LOADER: Running epalxeis-main.py
# PyQt5 not found in PYZ
# code object from 'C:\\Program Files (x86)\\Epalxeis Radio Player\\PyQt5\\__ini
t__.pyc'
import 'PyQt5' # <_frozen_importlib_external.SourcelessFileLoader object at 0x00
00000002D14A58>
# PyQt5.QtCore not found in PYZ
# PyQt5.sip not found in PYZ
# extension module 'PyQt5.sip' loaded from 'C:\\Program Files (x86)\\Epalxeis Ra
dio Player\\PyQt5\\sip.cp37-win_amd64.pyd'
# extension module 'PyQt5.sip' executed from 'C:\\Program Files (x86)\\Epalxeis
Radio Player\\PyQt5\\sip.cp37-win_amd64.pyd'
import 'PyQt5.sip' # <_frozen_importlib_external.ExtensionFileLoader object at 0
x0000000002D19358>
# extension module 'PyQt5.QtCore' loaded from 'C:\\Program Files (x86)\\Epalxeis
Radio Player\\PyQt5\\QtCore.pyd'
# extension module 'PyQt5.QtCore' executed from 'C:\\Program Files (x86)\\Epalxe
is Radio Player\\PyQt5\\QtCore.pyd'
import 'PyQt5.QtCore' # <_frozen_importlib_external.ExtensionFileLoader object a
t 0x0000000002D14C50>
# PyQt5.QtGui not found in PYZ
# extension module 'PyQt5.QtGui' loaded from 'C:\\Program Files (x86)\\Epalxeis
Radio Player\\PyQt5\\QtGui.pyd'
# extension module 'PyQt5.QtGui' executed from 'C:\\Program Files (x86)\\Epalxei
s Radio Player\\PyQt5\\QtGui.pyd'
import 'PyQt5.QtGui' # <_frozen_importlib_external.ExtensionFileLoader object at
0x0000000002DA9D68>
# PyQt5.QtWidgets not found in PYZ
# extension module 'PyQt5.QtWidgets' loaded from 'C:\\Program Files (x86)\\Epalx
eis Radio Player\\PyQt5\\QtWidgets.pyd'
# extension module 'PyQt5.QtWidgets' executed from 'C:\\Program Files (x86)\\Epa
lxeis Radio Player\\PyQt5\\QtWidgets.pyd'
import 'PyQt5.QtWidgets' # <_frozen_importlib_external.ExtensionFileLoader objec
t at 0x0000000002E37A20>
# pydub not found in PYZ
# code object from 'C:\\Program Files (x86)\\Epalxeis Radio Player\\pydub\\__ini
t__.pyc'
# pydub.audio_segment not found in PYZ
# code object from 'C:\\Program Files (x86)\\Epalxeis Radio Player\\pydub\\audio
_segment.pyc'
# __future__ not found in PYZ
# code object from 'C:\\Program Files (x86)\\Epalxeis Radio Player\\__future__.p
yc'
import '__future__' # <_frozen_importlib_external.SourcelessFileLoader object at
0x0000000002EE6EF0>
import 'array' # <class '_frozen_importlib.BuiltinImporter'>
# tempfile not found in PYZ
# code object from 'C:\\Program Files (x86)\\Epalxeis Radio Player\\tempfile.pyc
'
# shutil not found in PYZ
# code object from 'C:\\Program Files (x86)\\Epalxeis Radio Player\\shutil.pyc'
# bz2 not found in PYZ
# code object from 'C:\\Program Files (x86)\\Epalxeis Radio Player\\bz2.pyc'
# _compression not found in PYZ
# code object from 'C:\\Program Files (x86)\\Epalxeis Radio Player\\_compression
.pyc'
import '_compression' # <_frozen_importlib_external.SourcelessFileLoader object
at 0x0000000002F0C710>
# _bz2 not found in PYZ
# extension module '_bz2' loaded from 'C:\\Program Files (x86)\\Epalxeis Radio P
layer\\_bz2.pyd'
# extension module '_bz2' executed from 'C:\\Program Files (x86)\\Epalxeis Radio
Player\\_bz2.pyd'
import '_bz2' # <_frozen_importlib_external.ExtensionFileLoader object at 0x0000
000002F0CDD8>
import 'bz2' # <_frozen_importlib_external.SourcelessFileLoader object at 0x0000
000002F03DA0>
# lzma not found in PYZ
# code object from 'C:\\Program Files (x86)\\Epalxeis Radio Player\\lzma.pyc'
# _lzma not found in PYZ
# extension module '_lzma' loaded from 'C:\\Program Files (x86)\\Epalxeis Radio
Player\\_lzma.pyd'
# extension module '_lzma' executed from 'C:\\Program Files (x86)\\Epalxeis Radi
o Player\\_lzma.pyd'
import '_lzma' # <_frozen_importlib_external.ExtensionFileLoader object at 0x000
0000002F0D8D0>
import 'lzma' # <_frozen_importlib_external.SourcelessFileLoader object at 0x000
0000002F0CE80>
# pwd not found in PYZ
# grp not found in PYZ
import 'shutil' # <_frozen_importlib_external.SourcelessFileLoader object at 0x0
000000002EFC080>
# random not found in PYZ
# code object from 'C:\\Program Files (x86)\\Epalxeis Radio Player\\random.pyc'
# hashlib not found in PYZ
# code object from 'C:\\Program Files (x86)\\Epalxeis Radio Player\\hashlib.pyc'
# _hashlib not found in PYZ
# extension module '_hashlib' loaded from 'C:\\Program Files (x86)\\Epalxeis Rad
io Player\\_hashlib.pyd'
# extension module '_hashlib' executed from 'C:\\Program Files (x86)\\Epalxeis R
adio Player\\_hashlib.pyd'
import '_hashlib' # <_frozen_importlib_external.ExtensionFileLoader object at 0x
0000000002F25A90>
import '_blake2' # <class '_frozen_importlib.BuiltinImporter'>
import '_sha3' # <class '_frozen_importlib.BuiltinImporter'>
import 'hashlib' # <_frozen_importlib_external.SourcelessFileLoader object at 0x
0000000002F250B8>
# bisect not found in PYZ
# code object from 'C:\\Program Files (x86)\\Epalxeis Radio Player\\bisect.pyc'
import '_bisect' # <class '_frozen_importlib.BuiltinImporter'>
import 'bisect' # <_frozen_importlib_external.SourcelessFileLoader object at 0x0
000000002F256A0>
import '_random' # <class '_frozen_importlib.BuiltinImporter'>
import 'random' # <_frozen_importlib_external.SourcelessFileLoader object at 0x0
000000002EFC1D0>
import 'tempfile' # <_frozen_importlib_external.SourcelessFileLoader object at 0
x0000000002EEC518>
# wave not found in PYZ
# code object from 'C:\\Program Files (x86)\\Epalxeis Radio Player\\wave.pyc'
import 'audioop' # <class '_frozen_importlib.BuiltinImporter'>
# chunk not found in PYZ
# code object from 'C:\\Program Files (x86)\\Epalxeis Radio Player\\chunk.pyc'
import 'chunk' # <_frozen_importlib_external.SourcelessFileLoader object at 0x00
000000033E78D0>
import 'wave' # <_frozen_importlib_external.SourcelessFileLoader object at 0x000
0000002F1EEF0>
# pydub.logging_utils not found in PYZ
# code object from 'C:\\Program Files (x86)\\Epalxeis Radio Player\\pydub\\loggi
ng_utils.pyc'
# logging not found in PYZ
# code object from 'C:\\Program Files (x86)\\Epalxeis Radio Player\\logging\\__i
nit__.pyc'
# string not found in PYZ
# code object from 'C:\\Program Files (x86)\\Epalxeis Radio Player\\string.pyc'
import '_string' # <class '_frozen_importlib.BuiltinImporter'>
import 'string' # <_frozen_importlib_external.SourcelessFileLoader object at 0x0
000000003410320>
import 'logging' # <_frozen_importlib_external.SourcelessFileLoader object at 0x
00000000033F1048>
import 'pydub.logging_utils' # <_frozen_importlib_external.SourcelessFileLoader
object at 0x00000000033E7D68>
# pydub.utils not found in PYZ
# code object from 'C:\\Program Files (x86)\\Epalxeis Radio Player\\pydub\\utils
.pyc'
# json not found in PYZ
# code object from 'C:\\Program Files (x86)\\Epalxeis Radio Player\\json\\__init
__.pyc'
# json.decoder not found in PYZ
# code object from 'C:\\Program Files (x86)\\Epalxeis Radio Player\\json\\decode
r.pyc'
# json.scanner not found in PYZ
# code object from 'C:\\Program Files (x86)\\Epalxeis Radio Player\\json\\scanne
r.pyc'
import '_json' # <class '_frozen_importlib.BuiltinImporter'>
import 'json.scanner' # <_frozen_importlib_external.SourcelessFileLoader object
at 0x0000000003427B00>
import 'json.decoder' # <_frozen_importlib_external.SourcelessFileLoader object
at 0x0000000003427278>
# json.encoder not found in PYZ
# code object from 'C:\\Program Files (x86)\\Epalxeis Radio Player\\json\\encode
r.pyc'
import 'json.encoder' # <_frozen_importlib_external.SourcelessFileLoader object
at 0x00000000034279B0>
import 'json' # <_frozen_importlib_external.SourcelessFileLoader object at 0x000
0000003427048>
import 'pydub.utils' # <_frozen_importlib_external.SourcelessFileLoader object a
t 0x0000000003418160>
# base64 not found in PYZ
# code object from 'C:\\Program Files (x86)\\Epalxeis Radio Player\\base64.pyc'
import 'binascii' # <class '_frozen_importlib.BuiltinImporter'>
import 'base64' # <_frozen_importlib_external.SourcelessFileLoader object at 0x0
000000003427240>
# StringIO not found in PYZ
# pydub.exceptions not found in PYZ
# code object from 'C:\\Program Files (x86)\\Epalxeis Radio Player\\pydub\\excep
tions.pyc'
import 'pydub.exceptions' # <_frozen_importlib_external.SourcelessFileLoader obj
ect at 0x000000000343CB00>
# pydub.effects not found in PYZ
# code object from 'C:\\Program Files (x86)\\Epalxeis Radio Player\\pydub\\effec
ts.pyc'
# pydub.silence not found in PYZ
# code object from 'C:\\Program Files (x86)\\Epalxeis Radio Player\\pydub\\silen
ce.pyc'
import 'pydub.silence' # <_frozen_importlib_external.SourcelessFileLoader object
at 0x000000000344F278>
import 'pydub.effects' # <_frozen_importlib_external.SourcelessFileLoader object
at 0x0000000003448898>
import 'pydub.audio_segment' # <_frozen_importlib_external.SourcelessFileLoader
object at 0x0000000002ED7860>
import 'pydub' # <_frozen_importlib_external.SourcelessFileLoader object at 0x00
00000002ED7710>
# pydub.generators not found in PYZ
# code object from 'C:\\Program Files (x86)\\Epalxeis Radio Player\\pydub\\gener
ators.pyc'
import 'pydub.generators' # <_frozen_importlib_external.SourcelessFileLoader obj
ect at 0x0000000003448748>
# pyaudio not found in PYZ
# code object from 'C:\\Program Files (x86)\\Epalxeis Radio Player\\pyaudio.pyc'
# locale not found in PYZ
import locale # loaded from Zip C:\Program Files (x86)\Epalxeis Radio Player\bas
e_library.zip\locale.pyc
# _portaudio not found in PYZ
# extension module '_portaudio' loaded from 'C:\\Program Files (x86)\\Epalxeis R
adio Player\\_portaudio.cp37-win_amd64.pyd'
# extension module '_portaudio' executed from 'C:\\Program Files (x86)\\Epalxeis
Radio Player\\_portaudio.cp37-win_amd64.pyd'
import '_portaudio' # <_frozen_importlib_external.ExtensionFileLoader object at
0x0000000003465BE0>
import 'pyaudio' # <_frozen_importlib_external.SourcelessFileLoader object at 0x
000000000344F9B0>
# getpass not found in PYZ
# code object from 'C:\\Program Files (x86)\\Epalxeis Radio Player\\getpass.pyc'
# termios not found in PYZ
import 'getpass' # <_frozen_importlib_external.SourcelessFileLoader object at 0x
0000000003465BA8>
# datetime not found in PYZ
# code object from 'C:\\Program Files (x86)\\Epalxeis Radio Player\\datetime.pyc
'
import '_datetime' # <class '_frozen_importlib.BuiltinImporter'>
import 'datetime' # <_frozen_importlib_external.SourcelessFileLoader object at 0
x000000000347D550>
# epalxeis_radio not found in PYZ
# C:\Program Files (x86)\Epalxeis Radio Player\__pycache__\epalxeis_radio.cpytho
n-37.pyc matches C:\Program Files (x86)\Epalxeis Radio Player\epalxeis_radio.py
# code object from 'C:\\Program Files (x86)\\Epalxeis Radio Player\\__pycache__\
\epalxeis_radio.cpython-37.pyc'
# icons_rc not found in PYZ
# C:\Program Files (x86)\Epalxeis Radio Player\__pycache__\icons_rc.cpython-37.p
yc matches C:\Program Files (x86)\Epalxeis Radio Player\icons_rc.py
# code object from 'C:\\Program Files (x86)\\Epalxeis Radio Player\\__pycache__\
\icons_rc.cpython-37.pyc'
import 'icons_rc' # <_frozen_importlib_external.SourceFileLoader object at 0x000
000000347DC18>
import 'epalxeis_radio' # <_frozen_importlib_external.SourceFileLoader object at
0x000000000347D668>
# multiprocessing.connection not found in PYZ
# code object from 'C:\\Program Files (x86)\\Epalxeis Radio Player\\multiprocess
ing\\connection.pyc'
# _multiprocessing not found in PYZ
# extension module '_multiprocessing' loaded from 'C:\\Program Files (x86)\\Epal
xeis Radio Player\\_multiprocessing.pyd'
# extension module '_multiprocessing' executed from 'C:\\Program Files (x86)\\Ep
alxeis Radio Player\\_multiprocessing.pyd'
import '_multiprocessing' # <_frozen_importlib_external.ExtensionFileLoader obje
ct at 0x000000000349ADD8>
import 'multiprocessing.connection' # <_frozen_importlib_external.SourcelessFile
Loader object at 0x000000000348B080>
# multiprocessing.queues not found in PYZ
# code object from 'C:\\Program Files (x86)\\Epalxeis Radio Player\\multiprocess
ing\\queues.pyc'
# queue not found in PYZ
# code object from 'C:\\Program Files (x86)\\Epalxeis Radio Player\\queue.pyc'
# _queue not found in PYZ
# extension module '_queue' loaded from 'C:\\Program Files (x86)\\Epalxeis Radio
Player\\_queue.pyd'
# extension module '_queue' executed from 'C:\\Program Files (x86)\\Epalxeis Rad
io Player\\_queue.pyd'
import '_queue' # <_frozen_importlib_external.ExtensionFileLoader object at 0x00
000000034B3470>
import 'queue' # <_frozen_importlib_external.SourcelessFileLoader object at 0x00
00000003495FD0>
import 'multiprocessing.queues' # <_frozen_importlib_external.SourcelessFileLoad
er object at 0x000000000349AC50>
# multiprocessing.synchronize not found in PYZ
# code object from 'C:\\Program Files (x86)\\Epalxeis Radio Player\\multiprocess
ing\\synchronize.pyc'
import 'multiprocessing.synchronize' # <_frozen_importlib_external.SourcelessFil
eLoader object at 0x00000000034B3128>
# _bootlocale not found in PYZ
import _bootlocale # loaded from Zip C:\Program Files (x86)\Epalxeis Radio Playe
r\base_library.zip\_bootlocale.pyc
# encodings.cp1252 not found in PYZ
import encodings.cp1252 # loaded from Zip C:\Program Files (x86)\Epalxeis Radio
Player\base_library.zip\encodings\cp1252.pyc