0

Then i run from python, my code work fine. But? then i run compiled execution file, use cx_freeze, i get this error:

ERROR:network_service_instance_impl.cc(262)] Network service crashed, restarting service.

I wrote a simple repeatable code. In my main program, I load an HTML that is stored locally. In the example, I tried two options and they all produce the same error.

Python code:

import os, sys
from PySide2 import QtWidgets
from PySide2.QtWebEngineWidgets import QWebEngineView, QWebEngineSettings
from PySide2.QtCore import QUrl

app = QtWidgets.QApplication(sys.argv)
view = QWebEngineView()

file_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "html_example.html")

local_url = QUrl.fromLocalFile(file_path)
url = 'https://google.com'

view.load(local_url)
view.show()
sys.exit(app.exec_())

setup.py code :

# setup.py
# -*- coding: utf-8 -*-
from cx_Freeze import setup, Executable


include_files   = ['icons', 'UI' ]
options = {
    'build_exe': {'include_files'              : include_files }
}

# base = "Win32GUI"
setup(
    name            = 'works',
    version         ='1.0',
    description     = 'Tools',
    executables     = [Executable(script = "QtWebEngine_example.py")],
    options=options
)

html_example.html code:

<!DOCTYPE html>
<html>
<body>

<h2 title="I'm a header">Hello!</h2>


</body>
</html>

I don't even know in which direction to look for reasons. I use window os, python 3.8.10, PySide2-5.15.2.1

J Jack
  • 1
  • 1

0 Answers0