New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: No module named 'PyQt5.QtWebEngineWidgets' #2518

Closed
lutzhorn opened this Issue Mar 20, 2017 · 22 comments

Comments

Projects
None yet
3 participants
@lutzhorn

lutzhorn commented Mar 20, 2017

  • Ubuntu 16.04 LTS
  • Python 3.5.2
  • virtualenv 15.0.1
    $ pip3 install pyinstaller
    $ pip3 install PyQt5
    $ pip3 freeze
    ...
    PyInstaller==3.2.1
    PyQt5==5.8.1

run.spec:

# -*- mode: python -*-

block_cipher = None


a = Analysis(['run.py'],
             pathex=['lib/python3.5'],
             binaries=[],
             datas=[],
             hiddenimports=[],
             hookspath=[],
             runtime_hooks=[],
             excludes=[],
             win_no_prefer_redirects=False,
             win_private_assemblies=False,
             cipher=block_cipher)
pyz = PYZ(a.pure, a.zipped_data,
             cipher=block_cipher)
exe = EXE(pyz,
          a.scripts,
          a.binaries,
          a.zipfiles,
          a.datas,
          name='run',
          debug=False,
          strip=False,
          upx=True,
          console=True )

Python code run.py:

from PyQt5.QtWebEngineWidgets import QWebEngineView

Building:

$ pyinstaller --onefile  -p lib/python3.5 run.spec

Error:

ImportError: No module named 'PyQt5.QtWebEngineWidgets'
Failed to execute script run

What am I missing?

@htgoebel

This comment has been minimized.

Member

htgoebel commented Mar 20, 2017

Related: #2141.

Please try the current development version.

@htgoebel htgoebel added the hooks label Mar 20, 2017

@lutzhorn

This comment has been minimized.

lutzhorn commented Mar 20, 2017

Better but not good:

Could not find QtWebEngineProcess
@ghost

This comment has been minimized.

ghost commented Mar 20, 2017

The QtWebEngineProcess is a direct duplicate of #2141, which will be addressed by #2519. Feel free to give comments/feedback on that PR if you want!

@ghost

This comment has been minimized.

ghost commented Mar 20, 2017

@lutzhorn

So, here is where we are now:

Traceback (most recent call last):
  File "/tmp/pytest-of-travis/pytest-0/popen-gw1/test_PyQt5_QWebEngine_onedir_0/test_PyQt5_QWebEngine.py", line 4, in <module>
    from PyQt5.QtWebEngineWidgets import QWebEngineView
  File "/home/travis/build/pyinstaller/pyinstaller/PyInstaller/loader/pyimod03_importers.py", line 714, in load_module
    module = loader.load_module(fullname)
ImportError: /tmp/pytest-of-travis/pytest-0/popen-gw1/test_PyQt5_QWebEngine_onedir_0/dist/test_PyQt5_QWebEngine/libstdc++.so.6: version `GLIBCXX_3.4.18' not found (required by /tmp/pytest-of-travis/pytest-0/popen-gw1/test_PyQt5_QWebEngine_onedir_0/dist/test_PyQt5_QWebEngine/libQt5WebEngineCore.so.5)

Would you mind cloning my qtweb branch and then analyzing libQt5WebEngineCore.so with ldd to find out what its dependencies are?

@lutzhorn

This comment has been minimized.

lutzhorn commented Mar 20, 2017

In which repository do you have this branch? I can't find it here.

@ghost

This comment has been minimized.

ghost commented Mar 20, 2017

xoviat/pyinstaller

Also, it's qtweb, rather than qt5web. Sorry.

@lutzhorn

This comment has been minimized.

lutzhorn commented Mar 20, 2017

I see a qtweb branch there but no qt5web.

@ghost

This comment has been minimized.

ghost commented Mar 20, 2017

Yeah, sorry about the typo.

@lutzhorn

This comment has been minimized.

lutzhorn commented Mar 20, 2017

Sorry having to ask again: Where do I find the libQt5WebEngineCore.so? The PyQt5 I've installed using pip3 in the virtualenv does not include it.

@ghost

This comment has been minimized.

ghost commented Mar 20, 2017

That file should be generated after you run the patched pyinstaller in onedir mode on your script with qt webengine enabled. This message is coming from a test failure.

@lutzhorn

This comment has been minimized.

lutzhorn commented Mar 20, 2017

Sorry, no such so anywhere :(

$ pyinstaller --onedir  -p lib/python3.5 run.spec
...
$ tree build
build
└── run
    ├── base_library.zip
    ├── out00-Analysis.toc
    ├── out00-EXE.toc
    ├── out00-PKG.pkg
    ├── out00-PKG.toc
    ├── out00-PYZ.pyz
    ├── out00-PYZ.toc
    └── warnrun.txt

But I do find lib/python3.5/site-packages/PyQt5/QtWebEngineCore.so, probably installed by pip3 install PyQt5. Could the ldd of this be interesting?

@ghost

This comment has been minimized.

ghost commented Mar 20, 2017

No, it's tree dist.

@lutzhorn

This comment has been minimized.

lutzhorn commented Mar 20, 2017

I find this:

$ ldd ./dist/run/PyQt5.QtWebEngineCore.so
./dist/run/PyQt5.QtWebEngineCore.so: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.8' not found (required by ./dist/run/PyQt5.QtWebEngineCore.so)
./dist/run/PyQt5.QtWebEngineCore.so: /usr/lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5' not found (required by ./dist/run/PyQt5.QtWebEngineCore.so)
        linux-vdso.so.1 =>  (0x00007fff95b61000)
        libQt5WebEngineCore.so.5 => not found
        libQt5Quick.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Quick.so.5 (0x00007f1c95d99000)
        libQt5Gui.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Gui.so.5 (0x00007f1c95850000)
        libQt5WebChannel.so.5 => not found
        libQt5Qml.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Qml.so.5 (0x00007f1c95424000)
        libQt5Network.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Network.so.5 (0x00007f1c952c9000)
        libQt5Positioning.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Positioning.so.5 (0x00007f1c9528b000)
        libQt5Core.so.5 => /usr/lib/x86_64-linux-gnu/libQt5Core.so.5 (0x00007f1c94db5000)
        libGL.so.1 => /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 (0x00007f1c94b40000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f1c94923000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f1c945a1000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f1c94297000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f1c94081000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f1c93cb8000)
        libpng12.so.0 => /lib/x86_64-linux-gnu/libpng12.so.0 (0x00007f1c93a92000)
        libharfbuzz.so.0 => /usr/lib/x86_64-linux-gnu/libharfbuzz.so.0 (0x00007f1c93834000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f1c9361a000)
        libdouble-conversion.so.1 => /usr/lib/x86_64-linux-gnu/libdouble-conversion.so.1 (0x00007f1c93408000)
        libproxy.so.1 => /usr/lib/x86_64-linux-gnu/libproxy.so.1 (0x00007f1c931e7000)
        libicui18n.so.55 => /usr/lib/x86_64-linux-gnu/libicui18n.so.55 (0x00007f1c92d84000)
        libicuuc.so.55 => /usr/lib/x86_64-linux-gnu/libicuuc.so.55 (0x00007f1c929f0000)
        libpcre16.so.3 => /usr/lib/x86_64-linux-gnu/libpcre16.so.3 (0x00007f1c9278a000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f1c92585000)
        libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f1c92274000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f1c9206c000)
        /lib64/ld-linux-x86-64.so.2 (0x0000561012cbf000)
        libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f1c91e42000)
        libxcb-dri3.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri3.so.0 (0x00007f1c91c3f000)
        libxcb-present.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-present.so.0 (0x00007f1c91a3c000)
        libxcb-sync.so.1 => /usr/lib/x86_64-linux-gnu/libxcb-sync.so.1 (0x00007f1c91834000)
        libxshmfence.so.1 => /usr/lib/x86_64-linux-gnu/libxshmfence.so.1 (0x00007f1c91631000)
        libglapi.so.0 => /usr/lib/x86_64-linux-gnu/libglapi.so.0 (0x00007f1c91402000)
        libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007f1c911ef000)
        libXdamage.so.1 => /usr/lib/x86_64-linux-gnu/libXdamage.so.1 (0x00007f1c90fec000)
        libXfixes.so.3 => /usr/lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007f1c90de6000)
        libX11-xcb.so.1 => /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007f1c90be3000)
        libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007f1c908a9000)
        libxcb-glx.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-glx.so.0 (0x00007f1c90690000)
        libxcb-dri2.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri2.so.0 (0x00007f1c9048a000)
        libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f1c90268000)
        libXxf86vm.so.1 => /usr/lib/x86_64-linux-gnu/libXxf86vm.so.1 (0x00007f1c90062000)
        libdrm.so.2 => /usr/lib/x86_64-linux-gnu/libdrm.so.2 (0x00007f1c8fe52000)
        libfreetype.so.6 => /usr/lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007f1c8fba8000)
        libgraphite2.so.3 => /usr/lib/x86_64-linux-gnu/libgraphite2.so.3 (0x00007f1c8f982000)
        libicudata.so.55 => /usr/lib/x86_64-linux-gnu/libicudata.so.55 (0x00007f1c8decb000)
        libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f1c8dc5a000)
        libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007f1c8da56000)
        libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f1c8d84f000)
@ghost

This comment has been minimized.

ghost commented Mar 20, 2017

What is the output of tree dist? Travis at least adds the libQt5WebEngineCore.so, but it looks like you haven't even got that far.

@lutzhorn

This comment has been minimized.

lutzhorn commented Mar 21, 2017

dist
└── run
    ├── base_library.zip
    ├── _bz2.so
    ├── _codecs_cn.so
    ├── _codecs_hk.so
    ├── _codecs_iso2022.so
    ├── _codecs_jp.so
    ├── _codecs_kr.so
    ├── _codecs_tw.so
    ├── core
    ├── _ctypes.so
    ├── _decimal.so
    ├── _hashlib.so
    ├── include
    │   └── python3.5m
    │       └── pyconfig.h
    ├── _json.so
    ├── lib
    │   └── python3.5
    │       └── config-3.5m-x86_64-linux-gnu
    │           └── Makefile
    ├── lib2to3
    │   ├── Grammar.txt
    │   └── PatternGrammar.txt
    ├── libasound.so.2
    ├── libatk-1.0.so.0
    ├── libatk-bridge-2.0.so.0
    ├── libatspi.so.0
    ├── libavahi-client.so.3
    ├── libavahi-common.so.3
    ├── libboost_filesystem.so.1.58.0
    ├── libboost_system.so.1.58.0
    ├── libbz2.so.1.0
    ├── libcairo-gobject.so.2
    ├── libcairo.so.2
    ├── libcom_err.so.2
    ├── libcrypto.so.1.0.0
    ├── libcups.so.2
    ├── libdatrie.so.1
    ├── libdbus-1.so.3
    ├── libdrm.so.2
    ├── libEGL.so.1
    ├── libepoxy.so.0
    ├── libexpat.so.1
    ├── libffi.so.6
    ├── libfontconfig.so.1
    ├── libfreetype.so.6
    ├── libgbm.so.1
    ├── libgcc_s.so.1
    ├── libgcrypt.so.20
    ├── libgdk-3.so.0
    ├── libgdk_pixbuf-2.0.so.0
    ├── libgio-2.0.so.0
    ├── libglapi.so.0
    ├── libglib-2.0.so.0
    ├── libgmodule-2.0.so.0
    ├── libgmp.so.10
    ├── libgnutls.so.30
    ├── libgobject-2.0.so.0
    ├── libgpg-error.so.0
    ├── libgraphite2.so.3
    ├── libgssapi_krb5.so.2
    ├── libgthread-2.0.so.0
    ├── libgtk-3.so.0
    ├── libharfbuzz.so.0
    ├── libhogweed.so.4
    ├── libICE.so.6
    ├── libicudata.so.55
    ├── libicudata.so.56
    ├── libicui18n.so.56
    ├── libicuuc.so.55
    ├── libicuuc.so.56
    ├── libidn.so.11
    ├── libjasper.so.1
    ├── libjpeg.so.8
    ├── libk5crypto.so.3
    ├── libkeyutils.so.1
    ├── libkrb5.so.3
    ├── libkrb5support.so.0
    ├── liblzma.so.5
    ├── libmirclient.so.9
    ├── libmircommon.so.5
    ├── libmirprotobuf.so.3
    ├── libmpdec.so.2
    ├── libnettle.so.6
    ├── libnspr4.so
    ├── libnss3.so
    ├── libnssutil3.so
    ├── libp11-kit.so.0
    ├── libpango-1.0.so.0
    ├── libpangocairo-1.0.so.0
    ├── libpangoft2-1.0.so.0
    ├── libpcre.so.3
    ├── libpixman-1.so.0
    ├── libplc4.so
    ├── libplds4.so
    ├── libpng12.so.0
    ├── libprotobuf-lite.so.9
    ├── libpython3.5m.so.1.0
    ├── libQt5Core.so.5
    ├── libQt5DBus.so.5
    ├── libQt5Gui.so.5
    ├── libQt5Network.so.5
    ├── libQt5Positioning.so.5
    ├── libQt5PrintSupport.so.5
    ├── libQt5Qml.so.5
    ├── libQt5Quick.so.5
    ├── libQt5QuickWidgets.so.5
    ├── libQt5Svg.so.5
    ├── libQt5WebChannel.so.5
    ├── libQt5WebEngineCore.so.5
    ├── libQt5WebEngineWidgets.so.5
    ├── libQt5Widgets.so.5
    ├── libQt5XcbQpa.so.5
    ├── libreadline.so.6
    ├── libselinux.so.1
    ├── libsmime3.so
    ├── libSM.so.6
    ├── libssl.so.1.0.0
    ├── libstdc++.so.6
    ├── libsystemd.so.0
    ├── libtasn1.so.6
    ├── libthai.so.0
    ├── libtinfo.so.5
    ├── libuuid.so.1
    ├── libwayland-client.so.0
    ├── libwayland-cursor.so.0
    ├── libwayland-egl.so.1
    ├── libwayland-server.so.0
    ├── libX11.so.6
    ├── libX11-xcb.so.1
    ├── libXau.so.6
    ├── libxcb-glx.so.0
    ├── libxcb-present.so.0
    ├── libxcb-render.so.0
    ├── libxcb-shm.so.0
    ├── libxcb-sync.so.1
    ├── libxcb-xfixes.so.0
    ├── libXcomposite.so.1
    ├── libXcursor.so.1
    ├── libXdamage.so.1
    ├── libXdmcp.so.6
    ├── libXext.so.6
    ├── libXfixes.so.3
    ├── libXinerama.so.1
    ├── libXi.so.6
    ├── libxkbcommon.so.0
    ├── libxml2.so.2
    ├── libXrandr.so.2
    ├── libXrender.so.1
    ├── libxshmfence.so.1
    ├── libxslt.so.1
    ├── libXss.so.1
    ├── libXtst.so.6
    ├── libXxf86vm.so.1
    ├── libz.so.1
    ├── _lzma.so
    ├── mmap.so
    ├── _multibytecodec.so
    ├── _multiprocessing.so
    ├── _opcode.so
    ├── PyQt5.QtCore.so
    ├── PyQt5.QtGui.so
    ├── PyQt5.QtNetwork.so
    ├── PyQt5.QtPrintSupport.so
    ├── PyQt5.Qt.so
    ├── PyQt5.QtWebChannel.so
    ├── PyQt5.QtWebEngineCore.so
    ├── PyQt5.QtWebEngineWidgets.so
    ├── PyQt5.QtWidgets.so
    ├── qt5_plugins
    │   ├── bearer
    │   │   ├── libqconnmanbearer.so
    │   │   ├── libqgenericbearer.so
    │   │   └── libqnmbearer.so
    │   ├── iconengines
    │   │   └── libqsvgicon.so
    │   ├── imageformats
    │   │   ├── libqgif.so
    │   │   ├── libqicns.so
    │   │   ├── libqico.so
    │   │   ├── libqjp2.so
    │   │   ├── libqjpeg.so
    │   │   ├── libqsvg.so
    │   │   ├── libqtga.so
    │   │   ├── libqtiff.so
    │   │   ├── libqwbmp.so
    │   │   └── libqwebp.so
    │   ├── platforms
    │   │   ├── libqeglfs.so
    │   │   ├── libqlinuxfb.so
    │   │   ├── libqminimalegl.so
    │   │   ├── libqminimal.so
    │   │   ├── libqoffscreen.so
    │   │   ├── libqvnc.so
    │   │   └── libqxcb.so
    │   ├── platformthemes
    │   │   └── libqgtk3.so
    │   └── printsupport
    │       └── libcupsprintersupport.so
    ├── readline.so
    ├── requests
    │   └── cacert.pem
    ├── resource.so
    ├── run
    ├── sip.so
    ├── _ssl.so
    └── termios.so

15 directories, 193 files
@ghost

This comment has been minimized.

ghost commented Mar 21, 2017

So it is there:

image

Can I have the ldd then?

@lutzhorn

This comment has been minimized.

lutzhorn commented Mar 22, 2017

Here it is:

$ ldd ./lib/python3.5/site-packages/PyQt5/Qt/lib/libQt5WebChannel.so.5
        linux-vdso.so.1 =>  (0x00007ffcb3adb000)
        libQt5Qml.so.5 => /home/lutz/devenv/src/cqwc/desktoptrayclient-pyqt5/./lib/python3.5/site-packages/PyQt5/Qt/lib/libQt5Qml.so.5 (0x00007fcca5439000)
        libQt5Network.so.5 => /home/lutz/devenv/src/cqwc/desktoptrayclient-pyqt5/./lib/python3.5/site-packages/PyQt5/Qt/lib/libQt5Network.so.5 (0x00007fcca50b2000)
        libQt5Core.so.5 => /home/lutz/devenv/src/cqwc/desktoptrayclient-pyqt5/./lib/python3.5/site-packages/PyQt5/Qt/lib/libQt5Core.so.5 (0x00007fcca4992000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fcca4754000)
        libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fcca43d1000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fcca40c8000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fcca3eb2000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fcca3ae8000)
        librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fcca38e0000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fcca36c6000)
        libicui18n.so.56 => /home/lutz/devenv/src/cqwc/desktoptrayclient-pyqt5/./lib/python3.5/site-packages/PyQt5/Qt/lib/libicui18n.so.56 (0x00007fcca322c000)
        libicuuc.so.56 => /home/lutz/devenv/src/cqwc/desktoptrayclient-pyqt5/./lib/python3.5/site-packages/PyQt5/Qt/lib/libicuuc.so.56 (0x00007fcca2e74000)
        libicudata.so.56 => /home/lutz/devenv/src/cqwc/desktoptrayclient-pyqt5/./lib/python3.5/site-packages/PyQt5/Qt/lib/libicudata.so.56 (0x00007fcca1490000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fcca128c000)
        libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007fcca108a000)
        libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007fcca0d78000)
        /lib64/ld-linux-x86-64.so.2 (0x00005571f3292000)
        libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007fcca0b08000)
@lutzhorn

This comment has been minimized.

lutzhorn commented Mar 28, 2017

@xoviat Did the ldd output help you?

@lutzhorn

This comment has been minimized.

lutzhorn commented Apr 25, 2017

@xoviat Did the output from ldd help? Is there any other information you need?

@ghost

This comment has been minimized.

ghost commented Apr 25, 2017

Unfortunately the pull request merge rate has been too slow for my liking. Working on a project with many outstanding PRs can potentially create merge conflicts. I am going to wait on this until the current outstanding pull requests are merged.

@lutzhorn

This comment has been minimized.

lutzhorn commented Apr 25, 2017

Thank you for the information.

@bjones1

This comment has been minimized.

Member

bjones1 commented Jan 31, 2018

I'm closing this, since #3233 should fix it -- see the instructions there.

@bjones1 bjones1 closed this Jan 31, 2018

@htgoebel htgoebel added this to the PyInstaller 3.4 milestone Sep 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment