Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
240 views
in Technique[技术] by (71.8m points)

python - Using QWebEngine of Qt5

[14784] PyInstaller Bootloader 3.x
[14784] LOADER: executable is C:Users╫±?≤??≥DesktopPapinhio playerexedistPapinhio player.exe
[14784] LOADER: homepath is C:Users╫±?≤??≥DesktopPapinhio playerexedist
[14784] LOADER: _MEIPASS2 is NULL
[14784] LOADER: archivename is C:Users╫±?≤??≥DesktopPapinhio playerexedistPapinhio player.exe
[14784] LOADER: Cookie found at offset 0x5156904
[14784] LOADER: Extracting binaries
[14784] LOADER: creating directory C:UsersEFFA~1AppDataLocalTemp\_MEI147842 with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:UsersEFFA~1AppDataLocalTemp\_MEI147842PyQt5 with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:UsersEFFA~1AppDataLocalTemp\_MEI147842PyQt5Qt with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:UsersEFFA~1AppDataLocalTemp\_MEI147842PyQt5Qtin with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:UsersEFFA~1AppDataLocalTemp\_MEI147842PyQt5Qt
esources with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:UsersEFFA~1AppDataLocalTemp\_MEI147842PyQt5Qt	ranslations with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:UsersEFFA~1AppDataLocalTemp\_MEI147842PyQt5Qt	ranslationsqtwebengine_locales with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:UsersEFFA~1AppDataLocalTemp\_MEI147842asyncio with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:UsersEFFA~1AppDataLocalTemp\_MEI147842concurrent with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:UsersEFFA~1AppDataLocalTemp\_MEI147842concurrentfutures with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:UsersEFFA~1AppDataLocalTemp\_MEI147842ctypes with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:UsersEFFA~1AppDataLocalTemp\_MEI147842distutils with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:UsersEFFA~1AppDataLocalTemp\_MEI147842email with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:UsersEFFA~1AppDataLocalTemp\_MEI147842html with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:UsersEFFA~1AppDataLocalTemp\_MEI147842http with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:UsersEFFA~1AppDataLocalTemp\_MEI147842importlib with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:UsersEFFA~1AppDataLocalTemp\_MEI147842logging with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:UsersEFFA~1AppDataLocalTemp\_MEI147842multiprocessing with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:UsersEFFA~1AppDataLocalTemp\_MEI147842multiprocessingdummy with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:UsersEFFA~1AppDataLocalTemp\_MEI147842pydoc_data with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:UsersEFFA~1AppDataLocalTemp\_MEI147842unittest with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:UsersEFFA~1AppDataLocalTemp\_MEI147842urllib with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:UsersEFFA~1AppDataLocalTemp\_MEI147842xml with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:UsersEFFA~1AppDataLocalTemp\_MEI147842xmlparsers with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:UsersEFFA~1AppDataLocalTemp\_MEI147842xmlsax with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: creating directory C:UsersEFFA~1AppDataLocalTemp\_MEI147842xmlrpc with security string: D:(A;;FA;;;S-1-5-21-2491018127-1704774179-573031757-1001)
[14784] LOADER: Executing self as child
[14784] LOADER: set _MEIPASS2 to C:UsersEFFA~1AppDataLocalTemp\_MEI147842
[14784] LOADER: Setting up to run child
[14784] LOADER: Creating child process
[14784] LOADER: Waiting for child process to finish...
[11620] PyInstaller Bootloader 3.x
[11620] LOADER: executable is C:Users╫±?≤??≥DesktopPapinhio playerexedistPapinhio player.exe
[11620] LOADER: homepath is C:Users╫±?≤??≥DesktopPapinhio playerexedist
[11620] LOADER: _MEIPASS2 is C:UsersEFFA~1AppDataLocalTemp\_MEI147842
[11620] LOADER: archivename is C:Users╫±?≤??≥DesktopPapinhio playerexedistPapinhio player.exe
[11620] LOADER: Cookie found at offset 0x5156904
[11620] LOADER: SetDllDirectory(C:UsersEFFA~1AppDataLocalTemp\_MEI147842)
[11620] LOADER: Already in the child - running user's code.
[11620] LOADER: manifestpath: C:UsersEFFA~1AppDataLocalTemp\_MEI147842Papinhio player.exe.manifest
[11620] LOADER: Error activating the context: ActivateActCtx:
╠?? ?±?≤?▄???? ?±?≤??2 ??±??▄??????≥ ?±????????▌??≥ ???±??????≤?≥ ???±??≤??≥ ??▌??≈?, ?????? ?? ??±??▄???? ?±????????▌??≥ ???±??????≤?≥ ???±??≤??≥ ??≈? ??? ?±?≤???.

[11620] LOADER: ucrtbase.dll found: C:UsersEFFA~1AppDataLocalTemp\_MEI147842ucrtbase.dll
[11620] LOADER: Python library: C:UsersEFFA~1AppDataLocalTemp\_MEI147842python38.dll
[11620] LOADER: Loaded functions from Python library.
[11620] LOADER: Manipulating environment (sys.path, sys.prefix)
[11620] LOADER: sys.prefix is C:UsersEFFA~1AppDataLocalTemp\_MEI147842
[11620] LOADER: Pre-init sys.path is C:UsersEFFA~1AppDataLocalTemp\_MEI147842ase_library.zip;C:UsersEFFA~1AppDataLocalTemp\_MEI147842
[11620] LOADER: Setting runtime options
[11620] LOADER: Bootloader option: pyi-windows-manifest-filename Papinhio player.exe.manifest
[11620] LOADER: Runtime option: v
[11620] LOADER: Initializing python
import _frozen_importlib # frozen
import _imp # builtin
import '_thread' # <class '_frozen_importlib.BuiltinImporter'>
import '_warnings' # <class '_frozen_importlib.BuiltinImporter'>
import '_weakref' # <class '_frozen_importlib.BuiltinImporter'>
import '_frozen_importlib_external' # <class '_frozen_importlib.FrozenImporter'>
import '_io' # <class '_frozen_importlib.BuiltinImporter'>
import 'marshal' # <class '_frozen_importlib.BuiltinImporter'>
import 'nt' # <class '_frozen_importlib.BuiltinImporter'>
import _thread # previously loaded ('_thread')
import '_thread' # <class '_frozen_importlib.BuiltinImporter'>
import _weakref # previously loaded ('_weakref')
import '_weakref' # <class '_frozen_importlib.BuiltinImporter'>
import 'winreg' # <class '_frozen_importlib.BuiltinImporter'>
# installing zipimport hook
import 'time' # <class '_frozen_importlib.BuiltinImporter'>
import 'zipimport' # <class '_frozen_importlib.FrozenImporter'>
# installed zipimport hook
# zipimport: found 148 names in 'C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\base_library.zip'
import '_codecs' # <class '_frozen_importlib.BuiltinImporter'>
import codecs # loaded from Zip C:UsersEFFA~1AppDataLocalTemp\_MEI147842ase_library.zipcodecs.pyc
import encodings.aliases # loaded from Zip C:UsersEFFA~1AppDataLocalTemp\_MEI147842ase_library.zipencodingsaliases.pyc
import encodings # loaded from Zip C:UsersEFFA~1AppDataLocalTemp\_MEI147842ase_library.zipencodings\__init__.pyc
import encodings.utf_8 # loaded from Zip C:UsersEFFA~1AppDataLocalTemp\_MEI147842ase_library.zipencodingsutf_8.pyc
import encodings.cp1253 # loaded from Zip C:UsersEFFA~1AppDataLocalTemp\_MEI147842ase_library.zipencodingscp1253.pyc
import '_signal' # <class '_frozen_importlib.BuiltinImporter'>
import encodings.latin_1 # loaded from Zip C:UsersEFFA~1AppDataLocalTemp\_MEI147842ase_library.zipencodingslatin_1.pyc
import '_abc' # <class '_frozen_importlib.BuiltinImporter'>
import abc # loaded from Zip C:UsersEFFA~1AppDataLocalTemp\_MEI147842ase_library.zipabc.pyc
import io # loaded from Zip C:UsersEFFA~1AppDataLocalTemp\_MEI147842ase_library.zipio.pyc
[11620] LOADER: Overriding Python's sys.path
[11620] LOADER: Post-init sys.path is C:UsersEFFA~1AppDataLocalTemp\_MEI147842ase_library.zip;C:UsersEFFA~1AppDataLocalTemp\_MEI147842
[11620] LOADER: Setting sys.argv
[11620] LOADER: setting sys._MEIPASS
[11620] LOADER: importing modules from CArchive
[11620] LOADER: extracted struct
[11620] LOADER: callfunction returned...
import '_struct' # <class '_frozen_importlib.BuiltinImporter'>
[11620] LOADER: extracted pyimod01_os_path
[11620] LOADER: callfunction returned...
[11620] LOADER: extracted pyimod02_archive
[11620] LOADER: callfunction returned...
import 'zlib' # <class '_frozen_importlib.BuiltinImporter'>
[11620] LOADER: extracted pyimod03_importers
[11620] LOADER: callfunction returned...
[11620] LOADER: Installing PYZ archive with Python modules.
[11620] LOADER: PYZ archive: PYZ-00.pyz
[11620] LOADER: Running pyiboot01_bootstrap.py
# PyInstaller: FrozenImporter(C:UsersΧρ?στο?DesktopPapinhio playerexedistPapinhio player.exe?85267086)
# os not found in PYZ
# code object from 'C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\os.pyc'
# stat not found in PYZ
# code object from 'C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\stat.pyc'
import '_stat' # <class '_frozen_importlib.BuiltinImporter'>
import 'stat' # <_frozen_importlib_external.SourcelessFileLoader object at 0x000001B9BEA4A730>
# _collections_abc not found in PYZ
import _collections_abc # loaded from Zip C:UsersEFFA~1AppDataLocalTemp\_MEI147842ase_library.zip\_collections_abc.pyc
# ntpath not found in PYZ
# code object from 'C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\ntpath.pyc'
# genericpath not found in PYZ
# code object from 'C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\genericpath.pyc'
import 'genericpath' # <_frozen_importlib_external.SourcelessFileLoader object at 0x000001B9BEA7A940>
import 'ntpath' # <_frozen_importlib_external.SourcelessFileLoader object at 0x000001B9BEA57A30>
import 'os' # <_frozen_importlib_external.SourcelessFileLoader object at 0x000001B9BEA29E80>
# ctypes not found in PYZ
# code object from 'C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\ctypes\__init__.pyc'
# _ctypes not found in PYZ
# extension module '_ctypes' loaded from 'C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\_ctypes.pyd'
# extension module '_ctypes' executed from 'C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\_ctypes.pyd'
import '_ctypes' # <_frozen_importlib_external.ExtensionFileLoader object at 0x000001B9BEA879A0>
# ctypes._endian not found in PYZ
# code object from 'C:\Users\EFFA~1\AppData\Local\Temp\_MEI147842\ctypes\_endian.pyc'
import 'ctypes._endian' # <_frozen_importlib_external.SourcelessFileLoader object at 0x000001B9BEA99A30>
import 'ctypes' # <_frozen_importlib_external.SourcelessFileLoader object at 0x000001B9BEA439A0>
[11620] LOADER: Running pyi_rth_multiprocessing.py
# re not found in PYZ
# enum not found in PYZ
# types not found in PYZ
import types # loaded from Zip C:UsersEFFA~1AppDataLocalTemp\_MEI147842ase_library.zip	ypes.pyc
imp

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Solution:

  1. I uninstalled every version of Python i have in Windows.

  2. I installed python 3.9 @ C:Python

  3. I installed PyQt5 , pyqt5-tools with pip

  4. I installed pyinstaller via github (commands python setup.py build and python setup.py install)

  5. I add C:Python and C:PythonScripts to enviroment path.

  6. I move my project to C:PythonScripts

  7. I maked the executable(s) files with

pyinstaller --name="Papinhio player" --icon=../src/media/images/papinhio_player.ico ../src/main/python_files/Papinhio_player.py

command.

  1. I copy the contents of resources folder to dist folder ( from C:PythonScriptsPapinhio playerexedistPapinhio playerPyQt5Qt esources to C:PythonScriptsPapinhio playerexedist)

  2. I copy QtWebEngineProcess.exe from C:PythonScriptsPapinhio playerexedistPapinhio playerPyQt5Qtin to C:PythonScriptsPapinhio playerexedist

That's all!

I have some warnings like the following:

Qt WebEngine resources not found at C:/Users/EFFA~1/AppData/Local/Temp/resources. Trying parent directory...
Qt WebEngine resources not found at C:/Users/EFFA~1/AppData/Local/Temp. Trying application directory...
Installed Qt WebEngine locales directory not found at location C:/Users/EFFA~1/AppData/Local/Temp/translationsqtwebengine_locales. Trying application directory...
Qt WebEngine locales directory not found at location C:/Python/Scripts/Papinhio player/exe/distqtwebengine_locales. Trying fallback directory... Translations MAY NOT not be correct.
js: Unrecognized feature: 'clipboard-write'.
js: A cookie associated with a cross-site resource at http://youtube.com/ was set without the `SameSite` attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032.
js: A cookie associated with a cross-site resource at http://www.youtube.com/ was set without the `SameSite` attribute. A future release of Chrome will only deliver cookies with cross-site requests if they are set with `SameSite=None` and `Secure`. You can review cookies in developer tools under Application>Storage>Cookies and see more details at https://www.chromestatus.com/feature/5088147346030592 and https://www.chromestatus.com/feature/5633521622188032.

but the site is displayed correctly.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...