pyqt / python-qt5

Unofficial PyQt5 via PyPI for Python 2.7 64-bit on Windows
GNU General Public License v3.0
280 stars 77 forks source link

QWebview Crashes with a simple example #57

Open Schizo opened 4 years ago

Schizo commented 4 years ago

I did install qt with pip install git+git://github.com/pyqt/python-qt5.git in my virtual Python 2.7 environment. However, running this simple QWebView Snippet causes a crash. Any Ideas?

from PyQt5.QtWebEngineWidgets import QWebEngineView as QWebView,QWebEnginePage as QWebPage

from PyQt5.QtWidgets import QApplication
from PyQt5.QtCore import QUrl
import sys

class View:
    def __init__(self):
       self.view = QWebView()
       self.view.load(QUrl("https://google.com"))
       self.view.show()

if __name__ == '__main__':
    app = QApplication(sys.argv)
    view = View()

Stacktrace:

Qt WebEngine ICU data not found at C:/Qt/Qt5.7.1/5.7/msvc2015_64/resources. Trying parent directory...
Qt WebEngine ICU data not found at C:/Qt/Qt5.7.1/5.7/msvc2015_64. Trying application directory...
Qt WebEngine ICU data not found at D:/venvs/pyqt5Test/Scripts. Trying fallback directory... The application MAY NOT work.
Installed Qt WebEngine locales directory not found at location C:/Qt/Qt5.7.1/5.7/msvc2015_64/translations\qtwebengine_locales. Trying application directory...
Qt WebEngine locales directory not found at location D:/venvs/pyqt5Test/Scripts\qtwebengine_locales. Trying fallback directory... Translations MAY NOT not be correct.
[0510/220833:ERROR:icu_util.cc(162)] Invalid file descriptor to ICU data received.
[0510/220833:FATAL:icu_util.cc(265)] Check failed: result.
Backtrace:
        GetHandleVerifier [0x00007FF81AC10B61+9665]
        QtWebEngineCore::BrowserContextAdapter::isOffTheRecord [0x00007FF81ABDAFEC+262604]
        CertificateErrorController::resourceType [0x00007FF81B4C9528+3727544]
        QtWebEngineCore::FilePickerController::qt_static_metacall [0x00007FF81A1E5886+2686022]
        QtWebEngineCore::WebContentsAdapter::webContents [0x00007FF819F4AD9D+15821]
        QtWebEngineCore::WebContentsAdapter::webContents [0x00007FF819F4B0E6+16662]
        QtWebEngineCore::WebContentsAdapter::WebContentsAdapter [0x00007FF819F41397+135]
        QtWebEngineCore::WebContentsAdapter::WebContentsAdapter [0x00007FF819F41345+53]
        QWebEngineHistoryItem::url [0x00007FF8349B3658+1080]
        QWebEnginePage::QWebEnginePage [0x00007FF8349B39F1+145]
        QWebEnginePage::QWebEnginePage [0x00007FF8349B393D+45]
        QWebEngineView::load [0x00007FF8349BFDF5+53]
        (No symbol) [0x00007FF834B73919]
        PyCFunction_Call [0x000000001E0C3D49+105]
        PyEval_GetGlobals [0x000000001E1146D4+2372]
        PyEval_EvalFrameEx [0x000000001E117EE4+14084]
        PyEval_EvalCodeEx [0x000000001E119782+2018]
        PyFunction_SetClosure [0x000000001E0B5833+2675]
        PyObject_Call [0x000000001E08DAE5+101]
        PyMethod_New [0x000000001E09BFD1+2321]
        PyObject_Call [0x000000001E08DAE5+101]
        PyEval_CallObjectWithKeywords [0x000000001E112B88+200]
        PyInstance_New [0x000000001E09C92C+284]
        PyObject_Call [0x000000001E08DAE5+101]
        PyEval_GetGlobals [0x000000001E113ECB+315]
        PyEval_GetGlobals [0x000000001E11477A+2538]
        PyEval_EvalFrameEx [0x000000001E117EE4+14084]
        PyEval_EvalCodeEx [0x000000001E119782+2018]
        PyEval_EvalCode [0x000000001E119819+41]
        PyErr_Display [0x000000001E145FDA+1034]
        PyRun_FileExFlags [0x000000001E1472CA+170]
        PyRun_SimpleFileExFlags [0x000000001E147920+448]
        PyRun_AnyFileExFlags [0x000000001E148363+99]
        Py_Main [0x000000001E044D95+2453]
        (No symbol) [0x000000001D00119E]
        BaseThreadInitThunk [0x00007FF8DBCC7BD4+20]
        RtlUserThreadStart [0x00007FF8DD2CCE51+33]

It's looking for qtwebengine_locales but can't find it. Further details, if I don't specify the plugin path's, I'm getting an error, that the qwindow module wasn't found, so I'm setting:

set QT_PLUGIN_PATH=D:/venvs/pyqt5Test/Lib/site-packages/PyQt5/plugins
set QT_QPA_PLATFORM_PLUGIN_PATH=D:/venvs/pyqt5Test/Lib/site-packages/PyQt5/plugins/platforms