Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Need help building PySide with WebEngine
Forum Updated to NodeBB v4.3 + New Features

Need help building PySide with WebEngine

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
2 Posts 2 Posters 1.3k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    scherzo
    wrote on last edited by scherzo
    #1

    I've been trying to build PySide with WebEngine on Windows 10 x64 with MSVC 2019 and it's not working. I'll list below step by step what I'm doing.

    Building Qt6

    # Clone qt5 repo, dev branch (Qt6)
    git clone https://code.qt.io/qt/qt5.git
    cd qt5
    
    # Here I'm getting QtWebEngine source together with the default modules
    perl init-repository --module-subset="default,qtwebengine"
    
    # Little fix to get qlitehtml module as well
    cd qttools
    git submodule update --init --recursive
    
    # Change to dev branch , update submodules (chromium) and edit .qmake.conf to change Qt version from 6.0.2 to 6.2.0 just like with all other modules
    cd ..\qtwebengine
    git checkout dev
    git submodule update
    
    # Build and install Qt6
     ..\qt5\configure.bat -prefix "path\to\Qt\6.2.0" -release -nomake examples -nomake tests
    cmake --build .
    cmake --install .
    

    Building QtWebEngine

    # Here I remove Python 3 from PATH and set Python 2 paths
    set PATH=%PATH:C:\Program Files\Python39\Scripts\;=%
    set PATH=%PATH:C:\Program Files\Python39\;=%
    set PATH=%PATH%;C:\Python27
    set PATH=%PATH%;C:\Python27\Scripts
    
    # Setting PATH to gperf, bison and flex
    set PATH=%PATH%;C:\Users\scherzo\Downloads\gnuwin32\bin
    
    # Build and install QtWebEngine (takes about 4 hours because of Chromium)
    path\to\Qt\6.2.0\bin\qmake.exe -- -webengine-proprietary-codecs -webengine-webrtc -webengine-printing-and-pdf
    nmake
    nmake install
    

    Building PySide6

    # Clone pyside-setup repo, dev branch (Qt6)
    git clone https://code.qt.io/pyside/pyside-setup.git
    cd pyside-setup
    
    # Setting up virtualenv and requirements
    virtualenv venv
    venv\Scripts\activate
    pip install -r requirements.txt
    pip install numpy
    
    # Settting MSVC 2019 x64 environment variables
    call "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
    
    # Settting path to LLVM 12.0.0
    set LLVM_INSTALL_DIR=path\to\libclang
    python setup.py bdist_wheel --qmake=path\to\Qt\6.2.0\bin\qmake.exe --build-type=all
    

    During PySide6 building, I see the following message:

    -- optional module Qt6WebEngineCore skipped. Looked in: Qt6WebEngineCore_DIR-NOTFOUND
    CMake Warning at path/to/pyside-setup/sources/cmake_helpers/helpers.cmake:135 (find_package):
      By not providing "FindQt6WebEngine.cmake" in CMAKE_MODULE_PATH this project
      has asked CMake to find a package configuration file provided by
      "Qt6WebEngine", but CMake did not find one.
    
      Could not find a package configuration file provided by "Qt6WebEngine" with
      any of the following names:
    
        Qt6WebEngineConfig.cmake
        qt6webengine-config.cmake
    
      Add the installation prefix of "Qt6WebEngine" to CMAKE_PREFIX_PATH or set
      "Qt6WebEngine_DIR" to a directory containing one of the above files.  If
      "Qt6WebEngine" provides a separate development package or SDK, be sure it
      has been installed.
    Call Stack (most recent call first):
      path/to/pyside-setup/sources/cmake_helpers/helpers.cmake:102 (COLLECT_MODULE_IF_FOUND)
      CMakeLists.txt:160 (remove_skipped_modules)
    

    Everything (Qt6, QtWebEngine and PySide6) builds without any errors, however QtWebEngine bidings aren't added to PySide6. Building and installing QtWebEngine as above doesn't create cmake files (like, for example, Qt5WebEngineCoreConfig.cmake) inside path\to\Qt\6.2.0\lib\cmake as mentioned in this blog post: https://www.qt.io/blog/building-qt-webengine-against-other-qt-versions

    Does anyone know what I'm doing wrong?

    1 Reply Last reply
    0
    • P Offline
      P Offline
      Phoe
      wrote on last edited by
      #2

      For those who have landed on this page when trying to build Pyside2 with QtWebEngineWidgets (not sure for Pyside6 because it seemed to be excluded for now in it), you need to use MaintenanceTool.exe to add Qt5WebEngineWidgets module or reinstall Qt with Qt5WebEngineWidgets checked.

      After that, PySide2 build will include QtWebEngineWidgets.

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved