Qt msvc doesn't work for C++ or Python
-
I can’t get Qt6 to work with msvc for C++ or Phyton. I need QWebEngie in my project, I installed newest version (qt 6.8.2 msvc). I installed MS Visua Studio 2022 and redistributable for C++ 2015-2022.
CMake error:
"C:\Program Files\JetBrains\CLion 2022.3.1\bin\cmake\win\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug "-DCMAKE_MAKE_PROGRAM=C:/Program Files/JetBrains/CLion 2022.3.1/bin/ninja/win/ninja.exe" -DCMAKE_PREFIX_PATH=C:/Qt/6.8.2/msvc2022_64 -G Ninja -S C:\Users\dot\CLionProjects\mBoard-0.1.0 -B C:\Users\dot\CLionProjects\mBoard-0.1.0\build-msvc-1 -- Qt6 found at: C:/Qt/6.8.2/msvc2022_64/lib/cmake/Qt6 -- CMAKE_PREFIX_PATH is: C:/Qt/6.8.2/msvc2022_64/ -- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR) -- Qt6Widgets_DIR: C:/Qt/6.8.2/msvc2022_64/lib/cmake/Qt6Widgets -- Qt6Widgets found! Qt6Widgets_INCLUDE_DIRS: C:/Qt/6.8.2/msvc2022_64/include/QtWidgets;C:/Qt/6.8.2/msvc2022_64/include;C:/Qt/6.8.2/msvc2022_64/include/QtCore;C:/Qt/6.8.2/msvc2022_64/include/QtGui CMake Error at CMakeLists.txt:71 (message): QWidget not found!
missing vulkan wasn’t a problem with mingw. This projects run well when compiled with mingw.
Yesterday I installed PyQt6 to see if msvc will work for Python. It doesn’t. It just doesn’t want to work.
C:\Users\dot\PycharmProjects\Bujo\venv\Scripts\python.exe C:/Users/dot/PycharmProjects/Bujo/main.py Traceback (most recent call last): File "C:\Users\dot\PycharmProjects\Bujo\main.py", line 2, in <module> from PyQt6.QtWebEngineWidgets import QWebEngineView ImportError: DLL load failed while importing QtWebEngineWidgets:
This project uses virtual environment and PyQt6 and webengine installed via pip.
Lines 1-3:
from PyQt6.QtWidgets import QApplication, QMainWindow, QVBoxLayout, QWidget from PyQt6.QtWebEngineWidgets import QWebEngineView from PyQt6.QtCore import QUrl
For last few days I’ve tried many things. I don’t know how to solve this. I need qwebengine to work with c++, preferably. Any help or insight will be appreciated.
-
I can’t get Qt6 to work with msvc for C++ or Phyton. I need QWebEngie in my project, I installed newest version (qt 6.8.2 msvc). I installed MS Visua Studio 2022 and redistributable for C++ 2015-2022.
CMake error:
"C:\Program Files\JetBrains\CLion 2022.3.1\bin\cmake\win\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug "-DCMAKE_MAKE_PROGRAM=C:/Program Files/JetBrains/CLion 2022.3.1/bin/ninja/win/ninja.exe" -DCMAKE_PREFIX_PATH=C:/Qt/6.8.2/msvc2022_64 -G Ninja -S C:\Users\dot\CLionProjects\mBoard-0.1.0 -B C:\Users\dot\CLionProjects\mBoard-0.1.0\build-msvc-1 -- Qt6 found at: C:/Qt/6.8.2/msvc2022_64/lib/cmake/Qt6 -- CMAKE_PREFIX_PATH is: C:/Qt/6.8.2/msvc2022_64/ -- Could NOT find WrapVulkanHeaders (missing: Vulkan_INCLUDE_DIR) -- Qt6Widgets_DIR: C:/Qt/6.8.2/msvc2022_64/lib/cmake/Qt6Widgets -- Qt6Widgets found! Qt6Widgets_INCLUDE_DIRS: C:/Qt/6.8.2/msvc2022_64/include/QtWidgets;C:/Qt/6.8.2/msvc2022_64/include;C:/Qt/6.8.2/msvc2022_64/include/QtCore;C:/Qt/6.8.2/msvc2022_64/include/QtGui CMake Error at CMakeLists.txt:71 (message): QWidget not found!
missing vulkan wasn’t a problem with mingw. This projects run well when compiled with mingw.
Yesterday I installed PyQt6 to see if msvc will work for Python. It doesn’t. It just doesn’t want to work.
C:\Users\dot\PycharmProjects\Bujo\venv\Scripts\python.exe C:/Users/dot/PycharmProjects/Bujo/main.py Traceback (most recent call last): File "C:\Users\dot\PycharmProjects\Bujo\main.py", line 2, in <module> from PyQt6.QtWebEngineWidgets import QWebEngineView ImportError: DLL load failed while importing QtWebEngineWidgets:
This project uses virtual environment and PyQt6 and webengine installed via pip.
Lines 1-3:
from PyQt6.QtWidgets import QApplication, QMainWindow, QVBoxLayout, QWidget from PyQt6.QtWebEngineWidgets import QWebEngineView from PyQt6.QtCore import QUrl
For last few days I’ve tried many things. I don’t know how to solve this. I need qwebengine to work with c++, preferably. Any help or insight will be appreciated.
@Dot79677 said in Qt msvc doesn't work for C++ or Python:
ImportError: DLL load failed while importing QtWebEngineWidgets:
What is after this line?
Also, set QT_DEBUG_PLUGINS env variable and try again to see what the problem is exactly.
See https://doc.qt.io/qt-6/debug.html for more details."C:\Program Files\JetBrains\CLion 2022.3.1\bin\cmake\win\bin\cmake.exe" - it is better to use cmake.exe provided by the Qt Online INstaller. Also, do you use the MSVC preconfigured terminal to build?
-
@Dot79677 said in Qt msvc doesn't work for C++ or Python:
ImportError: DLL load failed while importing QtWebEngineWidgets:
What is after this line?
Also, set QT_DEBUG_PLUGINS env variable and try again to see what the problem is exactly.
See https://doc.qt.io/qt-6/debug.html for more details."C:\Program Files\JetBrains\CLion 2022.3.1\bin\cmake\win\bin\cmake.exe" - it is better to use cmake.exe provided by the Qt Online INstaller. Also, do you use the MSVC preconfigured terminal to build?
@jsulm
Full error message:C:\Users\dot\PycharmProjects\Bujo\venv\Scripts\python.exe C:/Users/dot/PycharmProjects/Bujo/main.py Traceback (most recent call last): File "C:\Users\dot\PycharmProjects\Bujo\main.py", line 2, in <module> from PyQt6.QtWebEngineWidgets import QWebEngineView ImportError: DLL load failed while importing QtWebEngineWidgets: Can't find procedure Process finished with exit code 1
I use msvc to build. Pycharm has venv that I installed a day before I wrote here.
After installing MS VStudio I noticed that it didn't add anythin to win env vars Path so I added manualy:
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.43.34808\bin\Hostx86\x64