Running standalone app using QWebEngineView created with PyInstaller on MacOS gives Couldn't mmap icu data file

Viewed 17

I want to create a standalone application, which used PyQt5 QWebEngineView. Creating the application with PyInstaller gives the following error when the application is executed:

Couldn't mmap icu data file

The error only arises on MacOS and only if --onefile mode is used. On Windows I don't have that problem.

In this post is a solution given in Chinese, which I don't understand.

I create a basic program to show the error:

from PyQt5.QtWidgets import *
from PyQt5.QtCore import *
from PyQt5.QtWebEngineWidgets import *
import sys

class App(QMainWindow):
    abort = pyqtSignal()

    def __init__(self):
        super(App, self).__init__()
        webView = QWebEngineView()
        webView.load(QUrl("https://www.google.de/"))

        self.setCentralWidget(webView)

app = QApplication(sys.argv)
window = App()
window.show()
sys.exit(app.exec_())

The spec-file looks like this:

# -*- mode: python ; coding: utf-8 -*-


block_cipher = None


a = Analysis(
    ['test.py'],
    pathex=[],
    binaries=[],
    datas=[],
    hiddenimports=[],
    hookspath=[],
    hooksconfig={},
    runtime_hooks=[],
    excludes=[],
    win_no_prefer_redirects=False,
    win_private_assemblies=False,
    cipher=block_cipher,
    noarchive=False,
)
pyz = PYZ(a.pure, a.zipped_data, cipher=block_cipher)

exe = EXE(
    pyz,
    a.scripts,
    a.binaries,
    a.zipfiles,
    a.datas,
    [],
    name='tesst',
    debug=False,
    bootloader_ignore_signals=False,
    strip=False,
    upx=True,
    upx_exclude=[],
    runtime_tmpdir=None,
    console=True,
    disable_windowed_traceback=False,
    argv_emulation=False,
    target_arch=None,
    codesign_identity=None,
    entitlements_file=None,
)

I use:

  • PyInstaller: 5.0.1
  • Python: 3.9.9
  • Platform: macOS-10.16-x86_64-i386-64bit

I gladly provide further info, if needed

0 Answers
Related