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

QtWebkit deprecated as of Qt5.6 #195

Closed
Crypta-Eve opened this Issue Mar 15, 2018 · 4 comments

Comments

Projects
None yet
2 participants
@Crypta-Eve

Crypta-Eve commented Mar 15, 2018

Im having trouble getting pywebview to work as I am using Qt 5.10, however this does not contain QtWebkit anymore. QtWebkit was deprecated in Qt5.5 and removed in 5.6.

Is there any chance of an update to QtWebEngine?

@Crypta-Eve

This comment has been minimized.

Crypta-Eve commented Mar 15, 2018

Hmmm. I got ahead of myself submitting this issue... Kinda...

I can see the code that detects QtVersion and loads the appropriate module(WebKit or WebEngine) but for some reson mine is trying to load QtWebKit despite having Qt5.10......

@Crypta-Eve

This comment has been minimized.

Crypta-Eve commented Mar 15, 2018

`python3
Python 3.6.3 (default, Oct 3 2017, 21:45:48)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

import webview
webview.create_window("It works, Jim!", "http://www.flowrl.com")
ERROR:webview:GTK cannot be loaded
Traceback (most recent call last):
File "/home/michael/.local/lib/python3.6/site-packages/webview/init.py", line 76, in _initialize_imports
import webview.gtk as gui
File "/home/michael/.local/lib/python3.6/site-packages/webview/gtk.py", line 19, in
gi.require_version('WebKit', '3.0')
File "/usr/lib/python3/dist-packages/gi/init.py", line 118, in require_version
raise ValueError('Namespace %s not available' % namespace)
ValueError: Namespace WebKit not available
ERROR:webview.qt:PyQt5 or one of dependencies is not found
Traceback (most recent call last):
File "/home/michael/.local/lib/python3.6/site-packages/webview/qt.py", line 29, in
from PyQt5.QtWebKitWidgets import QWebView
ModuleNotFoundError: No module named 'PyQt5.QtWebKitWidgets'
Segmentation fault (core dumped)
`

@shivaprsdv

This comment has been minimized.

Collaborator

shivaprsdv commented Mar 15, 2018

This is a bug in the current production code (pywebview 1.8). The problem is
with this line in webview/qt.py:

 26     if float(QT_VERSION_STR[:3]) > 5.5:

For Qt versions 5.10+, this wrongly evaluates to 5.1 > 5.5 and pywebview is
mistaken that your Qt version is below 5.5.

This was mentioned in issue #171 and rectified in PR #172. Your issue is likely
to be solved if you use the current master branch instead of the pip installed
one. The fix would be upstream in the next release. 🙂

@Crypta-Eve

This comment has been minimized.

Crypta-Eve commented Mar 16, 2018

Awesome thanks for your help. I will mark this as closed to reflect the code in master.

@Crypta-Eve Crypta-Eve closed this Mar 16, 2018

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