Python2 error during WebEngine build Qt 5.12.5
-
Hello!
I have an application written with Qt 5.12.5 which use the WebView control. In Linux it works perfectly, in Windows it cannot be built because the WebView cannot be found. I've googled a lot and finally I have understood that is necessary to build the WebEngine.
So I managed to create the build environment with:
-Python 2.7.9
-Bison, Flex
-GPerf
-ActivePerl
-Visual Studio 2017 Community Edition
-Windows 10 SDKAfter setting the MVSC vars and the appropriate paths, I have run the command configure -webengine-proprietary-codecs throught the console in the C:\Qt\5.12.5\Src folder.
Then I moved to the qtwebengine subfolder and ran qmake but this message error is appeared:
A suitable version of python2 could not be found.
QtWebEngine will not be built.I've re-checked all the environment settings, but nothing seems wrong.
Can anybody help me?
-
This is the result of the configure:
C:\Qt\5.12.5\Src>configure -webengine-proprietary-codecs + cd qtbase + C:\Qt\5.12.5\Src\qtbase\configure.bat -top-level -webengine-proprietary-codecs Bootstrapping qmake ... Microsoft (R) Program Maintenance Utility versione 14.16.27048.0 Copyright (C) Microsoft Corporation. Tutti i diritti riservati. Selecting Qt Edition. Type 'c' if you want to use the Commercial Edition. Type 'o' if you want to use the Open Source Edition. Which edition of Qt do you want to use? o This is the Qt Open Source Edition. You are licensed to use this software under the terms of the GNU Lesser General Public License (LGPL) version 3 or the GNU General Public License (GPL) version 2. Type 'L' to view the GNU Lesser General Public License version 3 (LGPLv3). Type 'G' to view the GNU General Public License version 2 (GPLv2). Type 'y' to accept this license offer. Type 'n' to decline this license offer. Do you accept the terms of either license? y Running configuration tests... Done running configuration tests. Configure summary: Build type: win32-msvc (i386, CPU features: sse sse2) Compiler: msvc 191627048 Configuration: sse2 aesni sse3 ssse3 sse4_1 sse4_2 avx avx2 avx512f avx512bw avx512cd avx512dq avx512er avx512ifma avx512pf avx512vbmi avx512vl compile_examples f16c largefile precompile_header rdrnd shani x86SimdAlways shared debug_and_release release debug build_all c++11 c++14 c++1z concurrent dbus no-pkg-config release_tools stl Build options: Mode ................................... debug and release; default link: debug; optimized tools Optimize release build for size ........ no Building shared libraries .............. yes Using C standard ....................... C89 Using C++ standard ..................... C++1z Using gold linker ...................... no Using precompiled headers .............. yes Using LTCG ............................. no Target compiler supports: SSE .................................. SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 AVX .................................. AVX AVX2 AVX512 ............................... F ER CD PF DQ BW VL IFMA VBMI Other x86 ............................ AES F16C RDRAND SHA Build parts ............................ libs examples tools App store compliance ................... no Qt modules and options: Qt Concurrent .......................... yes Qt D-Bus ............................... yes Qt D-Bus directly linked to libdbus .... no Qt Gui ................................. yes Qt Network ............................. yes Qt Sql ................................. yes Qt Testlib ............................. yes Qt Widgets ............................. yes Qt Xml ................................. yes Support enabled for: Using pkg-config ....................... no udev ................................... no Using system zlib ...................... no Qt Core: DoubleConversion ....................... yes Using system DoubleConversion ........ no GLib ................................... no iconv .................................. no ICU .................................... no Tracing backend ........................ <none> Logging backends: journald ............................. no syslog ............................... no slog2 ................................ no Using system PCRE2 ..................... no Qt Network: getifaddrs() ........................... no IPv6 ifname ............................ no libproxy ............................... no OpenSSL ................................ no Qt directly linked to OpenSSL ........ no OpenSSL 1.1 ............................ no DTLS ................................... no SCTP ................................... no Use system proxies ..................... yes Qt Gui: Accessibility .......................... yes FreeType ............................... yes Using system FreeType ................ no HarfBuzz ............................... yes Using system HarfBuzz ................ no Fontconfig ............................. no Image formats: GIF .................................. yes ICO .................................. yes JPEG ................................. yes Using system libjpeg ............... no PNG .................................. yes Using system libpng ................ no EGL .................................... yes OpenVG ................................. no OpenGL: ANGLE ................................ yes Combined ANGLE Library ............... no Desktop OpenGL ....................... no Dynamic OpenGL ....................... no OpenGL ES 2.0 ........................ yes OpenGL ES 3.0 ........................ no OpenGL ES 3.1 ........................ no OpenGL ES 3.2 ........................ no Vulkan ................................. no Session Management ..................... yes Features used by QPA backends: evdev .................................. no libinput ............................... no INTEGRITY HID .......................... no mtdev .................................. no tslib .................................. no xkbcommon .............................. no X11 specific: XLib ................................. no XCB Xlib ............................. no EGL on X11 ........................... no QPA backends: DirectFB ............................... no EGLFS .................................. no LinuxFB ................................ no VNC .................................... no Mir client ............................. no Windows: Direct 2D ............................ yes DirectWrite .......................... yes DirectWrite 2 ........................ yes Qt Sql: SQL item models ........................ yes Qt Widgets: GTK+ ................................... no Styles ................................. Fusion Windows WindowsVista Qt PrintSupport: CUPS ................................... no Qt Sql Drivers: DB2 (IBM) .............................. no InterBase .............................. no MySql .................................. no OCI (Oracle) ........................... no ODBC ................................... yes PostgreSQL ............................. no SQLite2 ................................ no SQLite ................................. yes Using system provided SQLite ......... no TDS (Sybase) ........................... no Qt Testlib: Tester for item models ................. yes Qt SerialBus: Socket CAN ............................. no Socket CAN FD .......................... no Further Image Formats: JasPer ................................. no MNG .................................... no TIFF ................................... yes Using system libtiff ................. no WEBP ................................... yes Using system libwebp ................. no Qt QML: QML network support .................... yes QML debugging and profiling support .... yes QML sequence object .................... yes QML list model ......................... yes QML XML http request ................... yes QML Locale ............................. yes QML delegate model ..................... yes Qt Quick: Direct3D 12 ............................ yes AnimatedImage item ..................... yes Canvas item ............................ yes Support for Qt Quick Designer .......... yes Flipable item .......................... yes GridView item .......................... yes ListView item .......................... yes TableView item ......................... yes Path support ........................... yes PathView item .......................... yes Positioner items ....................... yes Repeater item .......................... yes ShaderEffect item ...................... yes Sprite item ............................ yes Qt Scxml: ECMAScript data model for QtScxml ...... yes Qt Gamepad: SDL2 ................................... no Qt 3D: Assimp ................................. yes System Assimp .......................... no Output Qt3D Job traces ................. no Output Qt3D GL traces .................. no Use SSE2 instructions .................. no Use AVX2 instructions .................. no Aspects: Render aspect ........................ yes Input aspect ......................... yes Logic aspect ......................... yes Animation aspect ..................... yes Extras aspect ........................ yes Qt 3D Renderers: OpenGL Renderer ........................ yes Qt 3D GeometryLoaders: Autodesk FBX ........................... no Qt Wayland Client ........................ no Qt Wayland Compositor .................... no Qt Bluetooth: BlueZ .................................. no BlueZ Low Energy ....................... no Linux Crypto API ....................... no WinRT Bluetooth API (desktop & UWP) .... yes Qt Sensors: sensorfw ............................... no Qt Quick Controls 2: Styles ................................. Default Fusion Imagine Material Universal Qt Quick Templates 2: Hover support .......................... yes Multi-touch support .................... yes Qt Positioning: Gypsy GPS Daemon ....................... no WinRT Geolocation API .................. yes Qt Location: Qt.labs.location experimental QML plugin . yes Geoservice plugins: OpenStreetMap ........................ yes HERE ................................. yes Esri ................................. yes Mapbox ............................... yes MapboxGL ............................. no Itemsoverlay ......................... yes QtXmlPatterns: XML schema support ..................... yes Qt Multimedia: ALSA ................................... no GStreamer 1.0 .......................... no GStreamer 0.10 ......................... no Video for Linux ........................ no OpenAL ................................. no PulseAudio ............................. no Resource Policy (libresourceqt5) ....... no Windows Audio Services ................. yes DirectShow ............................. yes Windows Media Foundation ............... yes Media player backend ................... DirectShow Qt Tools: QDoc ................................... no Qt WebEngine: Embedded build ......................... no Full debug information ................. no Pepper Plugins ......................... yes Printing and PDF ....................... yes Proprietary Codecs ..................... yes Spellchecker ........................... yes Native Spellchecker .................... no WebRTC ................................. yes Use System Ninja ....................... no Geolocation ............................ yes WebChannel support ..................... yes Use v8 snapshot ........................ yes Kerberos Authentication ................ yes Note: No wayland-egl support detected. Cross-toolkit compatibility disabled. WARNING: QDoc will not be compiled, probably because libclang could not be located. This means that you cannot build the Qt documentation. Either ensure that llvm-config is in your PATH environment variable, or set LLVM_INSTALL_DIR to the location of your llvm installation. On Linux systems, you may be able to install libclang by installing the libclang-dev or libclang-devel package, depending on your distribution. On macOS, you can use Homebrew's llvm package. On Windows, you must set LLVM_INSTALL_DIR to the installation path. WARNING: Python version 2 (2.7.5 or later) is required to build QtWebEngine. Qt is now configured for building. Just run 'nmake'. Once everything is built, you must run 'nmake install'. Qt will be installed into 'C:\Qt\Qt-5.12.5'. Prior to reconfiguration, make sure you remove any leftovers from the previous build.
-
This is the result of the configure:
C:\Qt\5.12.5\Src>configure -webengine-proprietary-codecs + cd qtbase + C:\Qt\5.12.5\Src\qtbase\configure.bat -top-level -webengine-proprietary-codecs Bootstrapping qmake ... Microsoft (R) Program Maintenance Utility versione 14.16.27048.0 Copyright (C) Microsoft Corporation. Tutti i diritti riservati. Selecting Qt Edition. Type 'c' if you want to use the Commercial Edition. Type 'o' if you want to use the Open Source Edition. Which edition of Qt do you want to use? o This is the Qt Open Source Edition. You are licensed to use this software under the terms of the GNU Lesser General Public License (LGPL) version 3 or the GNU General Public License (GPL) version 2. Type 'L' to view the GNU Lesser General Public License version 3 (LGPLv3). Type 'G' to view the GNU General Public License version 2 (GPLv2). Type 'y' to accept this license offer. Type 'n' to decline this license offer. Do you accept the terms of either license? y Running configuration tests... Done running configuration tests. Configure summary: Build type: win32-msvc (i386, CPU features: sse sse2) Compiler: msvc 191627048 Configuration: sse2 aesni sse3 ssse3 sse4_1 sse4_2 avx avx2 avx512f avx512bw avx512cd avx512dq avx512er avx512ifma avx512pf avx512vbmi avx512vl compile_examples f16c largefile precompile_header rdrnd shani x86SimdAlways shared debug_and_release release debug build_all c++11 c++14 c++1z concurrent dbus no-pkg-config release_tools stl Build options: Mode ................................... debug and release; default link: debug; optimized tools Optimize release build for size ........ no Building shared libraries .............. yes Using C standard ....................... C89 Using C++ standard ..................... C++1z Using gold linker ...................... no Using precompiled headers .............. yes Using LTCG ............................. no Target compiler supports: SSE .................................. SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 AVX .................................. AVX AVX2 AVX512 ............................... F ER CD PF DQ BW VL IFMA VBMI Other x86 ............................ AES F16C RDRAND SHA Build parts ............................ libs examples tools App store compliance ................... no Qt modules and options: Qt Concurrent .......................... yes Qt D-Bus ............................... yes Qt D-Bus directly linked to libdbus .... no Qt Gui ................................. yes Qt Network ............................. yes Qt Sql ................................. yes Qt Testlib ............................. yes Qt Widgets ............................. yes Qt Xml ................................. yes Support enabled for: Using pkg-config ....................... no udev ................................... no Using system zlib ...................... no Qt Core: DoubleConversion ....................... yes Using system DoubleConversion ........ no GLib ................................... no iconv .................................. no ICU .................................... no Tracing backend ........................ <none> Logging backends: journald ............................. no syslog ............................... no slog2 ................................ no Using system PCRE2 ..................... no Qt Network: getifaddrs() ........................... no IPv6 ifname ............................ no libproxy ............................... no OpenSSL ................................ no Qt directly linked to OpenSSL ........ no OpenSSL 1.1 ............................ no DTLS ................................... no SCTP ................................... no Use system proxies ..................... yes Qt Gui: Accessibility .......................... yes FreeType ............................... yes Using system FreeType ................ no HarfBuzz ............................... yes Using system HarfBuzz ................ no Fontconfig ............................. no Image formats: GIF .................................. yes ICO .................................. yes JPEG ................................. yes Using system libjpeg ............... no PNG .................................. yes Using system libpng ................ no EGL .................................... yes OpenVG ................................. no OpenGL: ANGLE ................................ yes Combined ANGLE Library ............... no Desktop OpenGL ....................... no Dynamic OpenGL ....................... no OpenGL ES 2.0 ........................ yes OpenGL ES 3.0 ........................ no OpenGL ES 3.1 ........................ no OpenGL ES 3.2 ........................ no Vulkan ................................. no Session Management ..................... yes Features used by QPA backends: evdev .................................. no libinput ............................... no INTEGRITY HID .......................... no mtdev .................................. no tslib .................................. no xkbcommon .............................. no X11 specific: XLib ................................. no XCB Xlib ............................. no EGL on X11 ........................... no QPA backends: DirectFB ............................... no EGLFS .................................. no LinuxFB ................................ no VNC .................................... no Mir client ............................. no Windows: Direct 2D ............................ yes DirectWrite .......................... yes DirectWrite 2 ........................ yes Qt Sql: SQL item models ........................ yes Qt Widgets: GTK+ ................................... no Styles ................................. Fusion Windows WindowsVista Qt PrintSupport: CUPS ................................... no Qt Sql Drivers: DB2 (IBM) .............................. no InterBase .............................. no MySql .................................. no OCI (Oracle) ........................... no ODBC ................................... yes PostgreSQL ............................. no SQLite2 ................................ no SQLite ................................. yes Using system provided SQLite ......... no TDS (Sybase) ........................... no Qt Testlib: Tester for item models ................. yes Qt SerialBus: Socket CAN ............................. no Socket CAN FD .......................... no Further Image Formats: JasPer ................................. no MNG .................................... no TIFF ................................... yes Using system libtiff ................. no WEBP ................................... yes Using system libwebp ................. no Qt QML: QML network support .................... yes QML debugging and profiling support .... yes QML sequence object .................... yes QML list model ......................... yes QML XML http request ................... yes QML Locale ............................. yes QML delegate model ..................... yes Qt Quick: Direct3D 12 ............................ yes AnimatedImage item ..................... yes Canvas item ............................ yes Support for Qt Quick Designer .......... yes Flipable item .......................... yes GridView item .......................... yes ListView item .......................... yes TableView item ......................... yes Path support ........................... yes PathView item .......................... yes Positioner items ....................... yes Repeater item .......................... yes ShaderEffect item ...................... yes Sprite item ............................ yes Qt Scxml: ECMAScript data model for QtScxml ...... yes Qt Gamepad: SDL2 ................................... no Qt 3D: Assimp ................................. yes System Assimp .......................... no Output Qt3D Job traces ................. no Output Qt3D GL traces .................. no Use SSE2 instructions .................. no Use AVX2 instructions .................. no Aspects: Render aspect ........................ yes Input aspect ......................... yes Logic aspect ......................... yes Animation aspect ..................... yes Extras aspect ........................ yes Qt 3D Renderers: OpenGL Renderer ........................ yes Qt 3D GeometryLoaders: Autodesk FBX ........................... no Qt Wayland Client ........................ no Qt Wayland Compositor .................... no Qt Bluetooth: BlueZ .................................. no BlueZ Low Energy ....................... no Linux Crypto API ....................... no WinRT Bluetooth API (desktop & UWP) .... yes Qt Sensors: sensorfw ............................... no Qt Quick Controls 2: Styles ................................. Default Fusion Imagine Material Universal Qt Quick Templates 2: Hover support .......................... yes Multi-touch support .................... yes Qt Positioning: Gypsy GPS Daemon ....................... no WinRT Geolocation API .................. yes Qt Location: Qt.labs.location experimental QML plugin . yes Geoservice plugins: OpenStreetMap ........................ yes HERE ................................. yes Esri ................................. yes Mapbox ............................... yes MapboxGL ............................. no Itemsoverlay ......................... yes QtXmlPatterns: XML schema support ..................... yes Qt Multimedia: ALSA ................................... no GStreamer 1.0 .......................... no GStreamer 0.10 ......................... no Video for Linux ........................ no OpenAL ................................. no PulseAudio ............................. no Resource Policy (libresourceqt5) ....... no Windows Audio Services ................. yes DirectShow ............................. yes Windows Media Foundation ............... yes Media player backend ................... DirectShow Qt Tools: QDoc ................................... no Qt WebEngine: Embedded build ......................... no Full debug information ................. no Pepper Plugins ......................... yes Printing and PDF ....................... yes Proprietary Codecs ..................... yes Spellchecker ........................... yes Native Spellchecker .................... no WebRTC ................................. yes Use System Ninja ....................... no Geolocation ............................ yes WebChannel support ..................... yes Use v8 snapshot ........................ yes Kerberos Authentication ................ yes Note: No wayland-egl support detected. Cross-toolkit compatibility disabled. WARNING: QDoc will not be compiled, probably because libclang could not be located. This means that you cannot build the Qt documentation. Either ensure that llvm-config is in your PATH environment variable, or set LLVM_INSTALL_DIR to the location of your llvm installation. On Linux systems, you may be able to install libclang by installing the libclang-dev or libclang-devel package, depending on your distribution. On macOS, you can use Homebrew's llvm package. On Windows, you must set LLVM_INSTALL_DIR to the installation path. WARNING: Python version 2 (2.7.5 or later) is required to build QtWebEngine. Qt is now configured for building. Just run 'nmake'. Once everything is built, you must run 'nmake install'. Qt will be installed into 'C:\Qt\Qt-5.12.5'. Prior to reconfiguration, make sure you remove any leftovers from the previous build.
-
@jsulm the config.log contains this error:
loaded result for config test config.qtwebengine_core.tests.webengine-python2 'python2.exe' not found in PATH. Checking for 'python.exe'. Unsupported python version: ... A suitable Python 2 executable could not be located.
But python2.exe is in the path:
-
@jsulm the config.log contains this error:
loaded result for config test config.qtwebengine_core.tests.webengine-python2 'python2.exe' not found in PATH. Checking for 'python.exe'. Unsupported python version: ... A suitable Python 2 executable could not be located.
But python2.exe is in the path:
@Merlino It looks to me like the configure script ignores PATH (I assume the Python bin folder is there).
Check whether configure has some parameters to specify Python location (configure -h).What I noticed: to build Qt modules you should use the MSVC terminal which initialises the environment.
-
@Merlino It looks to me like the configure script ignores PATH (I assume the Python bin folder is there).
Check whether configure has some parameters to specify Python location (configure -h).What I noticed: to build Qt modules you should use the MSVC terminal which initialises the environment.
-
@jsulm Thank you for your answer, I've checked the configure switches and I have found:
configure -recheck-all
After this the Python2.exe has been correctly recognized.
-
@Merlino Did you run configure at least once before installing Python? That could explain the problem - I think configure caches its findings.
-