can not load enabled plugin: viewrendered3 bigdash

212 views
Skip to first unread message

lewis

unread,
Apr 25, 2016, 5:22:41 AM4/25/16
to leo-editor
I get this message about viewrendered3 and bigdash loading leo files:

Leo Log Window
Leo 5.3-devel, build 20160412153848, Tue Apr 12 15:38:48 CDT 2016
Git repo info: branch = master, commit = e89401da4f57
Python 3.5.1, PyQt version 5.6.0
Windows 7 AMD64 (build 6.1.7601) SP1
loadOnePlugin: can not load enabled plugin: leo.plugins.viewrendered3
loadOnePlugin: can not load enabled plugin: leo.plugins.bigdash
reading: N:\leo\workbook.leo

I have just installed pyQt v5.6

Regards
Lewis

lewis

unread,
Apr 25, 2016, 6:23:25 AM4/25/16
to leo-editor
Here is a traceback after running the vr command:

reading: N:\leo\workbook.leo

read 3 files in 0.02 seconds

read outline in 0.06 seconds

hook failed: idle, <bound method ViewRenderedController3.update of <leo.plugins.viewrendered3.ViewRenderedController3 object at 0x000000000C2D59D8>>, <no module>

Traceback (most recent call last):

  File "N:\git\leo-editor\leo\core\leoPlugins.py", line 328, in callTagHandler
    result = handler(tag, keywords)

  File "N:\git\leo-editor\leo\plugins\viewrendered3.py", line 695, in update
    f(s, keywords)

  File "N:\git\leo-editor\leo\plugins\viewrendered3.py", line 1120, in update_url
    self.update_rst(s, keywords)

  File "N:\git\leo-editor\leo\plugins\viewrendered3.py", line 1007, in update_rst
    w = pc.html_class(pc)

  File "N:\git\leo-editor\leo\plugins\viewrendered3.py", line 1292, in __init__
    self.view = self.init_view()

  File "N:\git\leo-editor\leo\plugins\viewrendered3.py", line 1299, in init_view
    view = QtWebKitWidgets.QWebView()

AttributeError: 'NoneType' object has no attribute 'QWebView'



Lewis

Edward K. Ream

unread,
Apr 25, 2016, 8:41:25 AM4/25/16
to leo-editor

​Presumably, you must install QtWebKitWidgets​
 separately.​

​EKR

lewis

unread,
Apr 25, 2016, 10:16:25 AM4/25/16
to leo-editor
The PyQt5 docs http://pyqt.sourceforge.net/Docs/PyQt5/introduction.html#  state 'PyQt5 comprises a number of different components. First of all there are a number of Python extension modules. These are all installed in the PyQt5 Python package.' and QtWebkitWidgets is included in the list.

As you can see from the log I have both python 3.5.1 and PyQt5 so it should be installed. I reinstalled to make sure I hadn't missed any option but no change.
Has anyone had a similar issue?

Regards
Lewis

Edward K. Ream

unread,
Apr 26, 2016, 1:01:56 PM4/26/16
to leo-editor
On Mon, Apr 25, 2016 at 9:16 AM, lewis <lewi...@operamail.com> wrote:
The PyQt5 docs http://pyqt.sourceforge.net/Docs/PyQt5/introduction.html#  state 'PyQt5 comprises a number of different components. First of all there are a number of Python extension modules. These are all installed in the PyQt5 Python package.' and
​​
​​
QtWebkitWidgets is included in the list.

​I just checked that viewrendered3.py uses the proper way to get access to Qt:

from leo.core.leoQt import phonon, QtSvg, QtWebKitWidgets, QUrl​
 

​It's possible that PyQt5 uses different imports than PyQt4 for ​
​​
QtWebkitWidgets, and that might make leo.core.leoQt return None for ​
​​
QtWebkitWidgets. The relevant code inside leoQt is:

try:
    import PyQt5.QtWebKitWidgets as QtWebKitWidgets
except ImportError:
    QtWebKitWidgets = None

Please try the following in a test .py file (or within Leo) and report the results:

import PyQt5.QtWebKitWidgets as QtWebKitWidgets

Edward

lewis

unread,
Apr 27, 2016, 9:22:28 AM4/27/16
to leo-editor
Here is the result of running
import PyQt5.QtWebKitWidgets as QtWebKitWidgets

exception executing script
Traceback (most recent call last):
  File "N:\git\leo-editor\leo\core\leoCommands.py", line 1700, in executeScript
    c.executeScriptHelper(args, define_g, define_name, namespace, script)
  File "N:\git\leo-editor\leo\core\leoCommands.py", line 1735, in executeScriptHelper
    exec(compile(script, scriptFile, 'exec'), d)
  File "C:\Users\lewis\.leo\scriptFile.py", line 3, in <module>
    import PyQt5.QtWebKitWidgets as QtWebKitWidgets
ImportError: No module named 'PyQt5.QtWebKitWidgets'
--------------------
  line 1: #@+leo-ver=5
* line 2: #@+node:lewis.20160427225844.1: * test PyQt5 node
  line 3: import PyQt5.QtWebKitWidgets as QtWebKitWidgets
  line 4: #@-leo

Regards
Lewis

Edward K. Ream

unread,
Apr 27, 2016, 2:15:34 PM4/27/16
to leo-editor
On Wed, Apr 27, 2016 at 8:22 AM, lewis <lewi...@operamail.com> wrote:
Here is the result of running
import PyQt5.QtWebKitWidgets as QtWebKitWidgets

exception executing script
Traceback (most recent call last):
  File "N:\git\leo-editor\leo\core\leoCommands.py", line 1700, in executeScript
    c.executeScriptHelper(args, define_g, define_name, namespace, script)
  File "N:\git\leo-editor\leo\core\leoCommands.py", line 1735, in executeScriptHelper
    exec(compile(script, scriptFile, 'exec'), d)
  File "C:\Users\lewis\.leo\scriptFile.py", line 3, in <module>
    import PyQt5.QtWebKitWidgets as QtWebKitWidgets
ImportError: No module named '
​​
PyQt5.QtWebKitWidgets'

QtWebKitWidgets does not seem available. This looks like an installation problem. You might try googling ​PyQt5.QtWebKitWidgets for more info.

EKR

lewis

unread,
Apr 28, 2016, 7:21:02 AM4/28/16
to leo-editor
Hi Edward,

I didn't found anything specific about QtWebKitWidgets installation problems, but this issue on the Spyder-IDE site is possibly relevant: https://github.com/spyder-ide/spyder/issues/3073

Also this from the PyQt5 5.6.1.dev changelog:
'changeset: 06ecf8131050
date:        Mon Apr 25 09:33:33 2016 +0100 
Fixed the Windows installers so that QtWebEngineProcess works.'

Regards
Lewis

john lunzer

unread,
Apr 28, 2016, 7:31:41 AM4/28/16
to leo-editor
Lewis, it doesn't seem too likely that is related. QtWebEngine is a different web platform based on Chromium (versus WebKit). So the two are likely unrelated, QtWebEngine was added after QtWebEngine.

Sami J

unread,
May 3, 2016, 10:17:28 AM5/3/16
to leo-editor
Hi all,
I tried to post a comment in this thread earlier today but since I don't see it published maybe something went wrong, so I do it again just in case.

In short, it seems that QtWebKit and QtWebKitWidgets are not being installed for PyQt5 anymore on Windows since they have been deprecated and removed upstream in Qt version 5.6.

QtWebKit/QtWebKitWidgets have apparently been replaced by QtWebEngine/QtWebEngineWidgets, which are indeed installed on Windows using the current PyQt5 binaries.

This means that Leo users on Windows/PyQt 5.6 cannot use the viewrendered plugins if this relies on QtWebKitWidgets.

Perhaps the plugin can be updated to use QtWebEngine/QtWebEngineWidgets instead?

Sami J

unread,
May 3, 2016, 10:17:28 AM5/3/16
to leo-editor
Lewis,
I had the same issue and I noticed that QtWebKit and QtWebKitWidgets had not been installed at all by the current Windows installers for PyQt5 5.6.0.
They are not even packaged in these installers.

I followed this up on the PyQt mailing list and I was told that QtWebKit had been deprecated upstream in Qt 5.5 and removed in 5.6,
so presumably that's why is not available in the PyQt5  Windows installers anymore.
I assume this also applies to QtWebKitWidgets.

If so, this is an issue for all users of the viewrendered plugin who are using PyQt5 version 5.6.0 on Windows.
Perhaps viewrendered should be updated to use QtWebEngine (including QtWebEngineWidgets), which is replacing QtWebKit?

Any thoughts?


On Monday, April 25, 2016 at 6:22:41 PM UTC+9, lewis wrote:

john lunzer

unread,
May 3, 2016, 10:41:11 AM5/3/16
to leo-e...@googlegroups.com
Thank you for the investigative work. It seems the logical path forward is to migrate to QtWebEngine to ensure future usability.

elgu...@gmail.com

unread,
Jul 12, 2016, 11:14:09 AM7/12/16
to leo-editor
anyone know what's happening about this issue? i just installed leo from git and have python 3.5.2 and pyqt 5.6 on this system, so the rendered view does not work for me at all because of this. :(

rengel

unread,
Jul 13, 2016, 3:35:51 AM7/13/16
to leo-e...@googlegroups.com
On Tuesday, July 12, 2016 at 5:14:09 PM UTC+2, elgu...@gmail.com wrote:
anyone know what's happening about this issue? i just installed leo from git and have python 3.5.2 and pyqt 5.6 on this system, so the rendered view does not work for me at all because of this. :(

IMHO this is an issue (bug) in Leo. From leoQt.py

...
    try:
        from PyQt5 import QtWebKit
    except ImportError:
        QtWebKit = None
...
Not finding QtWebKit any longer (in pyqt 5.6), Leo simply sets QtWebKit to None. Presto, you have your error.
Then this error is propagated to bigdash.py, leomylin.py, richtext.py, viewrendered*.py. This should be fixed by the powers that be.



Reinhard

 

Stephen Gava

unread,
Jul 13, 2016, 4:08:37 AM7/13/16
to leo-e...@googlegroups.com
On 13/7/16 5:35 PM, rengel wrote:
> IMHO this is an issue (bug) in Leo. From leoQt.py
>
> ...
> try:
> from PyQt5 import QtWebKit
> except ImportError:
> QtWebKit = None
> ...
> Not finding QtWebKit any longer (in pyqt 5.6), Leo simply sets
> QtWebKit to None. Presto, you have your error.
>
> Reinhard

yes. i'm aware of what causes the issue. what i want to know is what's
happening with it being resolved?

the renderer needs to be fixed to support QtWebEngine, as john lunzer
points out above, so that it will work on pyqt 5.6 and above.

does anyone know if this is being fixed?


rengel

unread,
Jul 13, 2016, 6:20:26 AM7/13/16
to leo-editor
yes. i'm aware of what causes the issue. what i want to know is what's
happening with it being resolved?

the renderer needs to be fixed to support QtWebEngine, as john lunzer
points out above, so that it will work on pyqt 5.6 and above.

does anyone know if this is being fixed?

Well, I don't know, if it this is being fixed, but I know, how this can be fixed:
In leoQt.py outcomment and insert the following lines:

 ...
    try:
        # from PyQt5 import QtWebKit
        from PyQt5 import QtWebEngineCore as QtWebKit
    except ImportError:
        QtWebKit = None
    try:
        #import PyQt5.QtWebKitWidgets as QtWebKitWidgets
        import PyQt5.QtWebEngineWidgets as QtWebKitWidgets
        QtWebKitWidgets.QWebView = QtWebKitWidgets.QWebEngineView
    except ImportError:
        QtWebKitWidgets = None
...

At least, this allows me to show the viewrendered pane. If there are other implications, I don't know.

Reinhard


Stephen Gava

unread,
Jul 13, 2016, 6:45:52 AM7/13/16
to leo-e...@googlegroups.com
yes, this would work if the interface to and behaviour of QtWebEngineWidgets and QtWebKitWidgets is identical, but i don't know.
--
You received this message because you are subscribed to a topic in the Google Groups "leo-editor" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/leo-editor/J_wVIzqQzXg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to leo-editor+...@googlegroups.com.
To post to this group, send email to leo-e...@googlegroups.com.
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.


Edward K. Ream

unread,
Jul 13, 2016, 12:15:25 PM7/13/16
to leo-editor
On Wed, Jul 13, 2016 at 5:45 AM, Stephen Gava <elgu...@gmail.com> wrote:
yes, this would work if the interface to and behaviour of QtWebEngineWidgets and QtWebKitWidgets is identical, but i don't know.

On 13/7/16 8:20 PM, rengel wrote:
yes. i'm aware of what causes the issue. what i want to know is what's
happening with it being resolved?

the renderer needs to be fixed to support QtWebEngine, as john lunzer
points out above, so that it will work on pyqt 5.6 and above.

does anyone know if this is being fixed?

Well, I don't know, if it this is being fixed, but I know, how this can be fixed:
In leoQt.py outcomment and insert the following lines:

 ...
    try:
        # from PyQt5 import QtWebKit
        from PyQt5 import QtWebEngineCore as QtWebKit
    except ImportError:
        QtWebKit = None
    try:
        #import PyQt5.QtWebKitWidgets as QtWebKitWidgets
        import PyQt5.QtWebEngineWidgets as QtWebKitWidgets
        QtWebKitWidgets.QWebView = QtWebKitWidgets.QWebEngineView
    except ImportError:
        QtWebKitWidgets = None
...

At least, this allows me to show the viewrendered pane. If there are other implications, I don't know.

Rev 582fe79 attempts a fix.  The only significant change is the following:

​
    try:
        from PyQt5 import QtWebKit
    except ImportError:
        # 2016/07/13: Reinhard: Support pyqt 5.6...
        try:

            from PyQt5 import QtWebEngineCore as QtWebKit
        except ImportError:
            QtWebKit = None
    try:
        import PyQt5.QtWebKitWidgets as QtWebKitWidgets
    except ImportError:
        try:
            # 2016/07/13: Reinhard: Support pyqt 5.6...

            import PyQt5.QtWebEngineWidgets as QtWebKitWidgets
            QtWebKitWidgets.QWebView = QtWebKitWidgets.QWebEngineView
        except ImportError:
            QtWebKitWidgets = None​

Some notes:

1. QtWebKit is used only in the richtext plugin, so the assignment QtWebKit = None is unlikely to be involved directly.  However, I see no reason not to change the code as shown above.

2. In general, we want to retain existing imports to ensure backward compatibility.  For this reason, the new imports, namely:


    import PyQt5.QtWebEngineWidgets as QtWebKitWidgets
    QtWebKitWidgets.QWebView = QtWebKitWidgets.QWebEngineView



are tried only if this fails:

    import PyQt5.QtWebKitWidgets as QtWebKitWidgets

I have not tested this in detail, and certainly not with pyqt 5.6.  Please report any problems.

Edward

Stephen Gava

unread,
Jul 13, 2016, 12:33:28 PM7/13/16
to leo-e...@googlegroups.com
On 14/7/16 2:15 AM, Edward K. Ream wrote:
[...snip...]

I have not tested this in detail, and certainly not with pyqt 5.6.  Please report any problems.

Edward

thanks Edward.  ;)   i will test this, with pyqt 5.6  when i get a chance tomorrow arvo.

my only concern was whether full compatibility for whatever api functions you are using from QtWebKit is retained
in the QTWebEngine code that replaces it from pyqt 5.6 onward. hopefully the nice qt and pyqt folk have been kind. 

rengel

unread,
Jul 13, 2016, 3:28:56 PM7/13/16
to leo-e...@googlegroups.com
Rev 582fe79 attempts a fix.  The only significant change is the following:

​    try:
        from PyQt5 import QtWebKit
    except ImportError:
        # 2016/07/13: Reinhard: Support pyqt 5.6...
        try:
            from PyQt5 import QtWebEngineCore as QtWebKit
        except ImportError:
            QtWebKit = None
    try:
        import PyQt5.QtWebKitWidgets as QtWebKitWidgets
    except ImportError:
        try:
            # 2016/07/13: Reinhard: Support pyqt 5.6...
            import PyQt5.QtWebEngineWidgets as QtWebKitWidgets
            QtWebKitWidgets.QWebView = QtWebKitWidgets.QWebEngineView
        except ImportError:
            QtWebKitWidgets = None​

I'm afraid, it's not that easy. We need some more  assignments (in red):

    try:
        from PyQt5 import QtWebKit
    except ImportError:
        # 2016/07/13: Reinhard: Support pyqt 5.6...
        try:

            from PyQt5 import QtWebEngineCore as QtWebKit
        except ImportError:
            QtWebKit = None
    try:
        import PyQt5.QtWebKitWidgets as QtWebKitWidgets
    except ImportError:
        try:
            # 2016/07/13: Reinhard: Support pyqt 5.6...

            import PyQt5.QtWebEngineWidgets as QtWebKitWidgets
            QtWebKitWidgets.QWebView = QtWebKitWidgets.QWebEngineView

            # used by richtext.py
            QtWebKit.QWebSettings = QtWebKitWidgets.QWebEngineSettings
            # used by viewrendered(2|3).py, bigdash.py
            QtWebKitWidgets.QWebPage = QtWebKitWidgets.QWebEnginePage
            # used by viewrendered(2|3).py
            QtWebKitWidgets.QWebSettings = QtWebKitWidgets.QWebEngineSettings
            
        except ImportError:
            QtWebKitWidgets = None​
 
Reinhard

rengel

unread,
Jul 14, 2016, 2:23:44 AM7/14/16
to leo-e...@googlegroups.com
As an addition, for anybody to test, here my Leo script which I used for checking the imports:

import PyQt5.QtWebEngineCore as QtWebKit
import PyQt5.QtWebEngineWidgets as QtWebKitWidgets

g
.es(QtWebKit)
g
.es(QtWebKitWidgets)

# used by all
QtWebKitWidgets.QWebView = QtWebKitWidgets.QWebEngineView
g
.es(QtWebKitWidgets.QWebView)


# used by richtext.py
QtWebKit.QWebSettings = QtWebKitWidgets.QWebEngineSettings

g
.es(QtWebKit.QWebSettings)


# used by viewrendered(2|3).py, bigdash.py
QtWebKitWidgets.QWebPage = QtWebKitWidgets.QWebEnginePage

g
.es(QtWebKitWidgets.QWebPage)


# used by viewrendered(2|3).py
QtWebKitWidgets.QWebSettings = QtWebKitWidgets.QWebEngineSettings

g
.es(QtWebKitWidgets.QWebSettings)



Reinhard


Stephen Gava

unread,
Jul 14, 2016, 10:18:35 AM7/14/16
to leo-e...@googlegroups.com
thanks for all your work on this Reinhard. i will try to find time to do a pull and test all your fixes when Edward has committed them to git.


On 14/7/16 4:23 PM, rengel wrote:
Reply all
Reply to author
Forward
0 new messages