Skip to content
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

wx.html2.WebView NotImplementedError (Ubuntu GTK) #2028

Closed
Patitotective opened this issue Nov 17, 2021 · 2 comments
Closed

wx.html2.WebView NotImplementedError (Ubuntu GTK) #2028

Patitotective opened this issue Nov 17, 2021 · 2 comments

Comments

@Patitotective
Copy link

Operating system: Ubuntu 20.04
wxPython version & source: 4.1.1 gtk3 (phoenix) wxWidgets 3.1.5 (built wheel from PyPi).
Python version & source: Python 3.9.5.

Description of the problem

I'm trying to implement a loading spinner animation as html and css into a wx.html2.WebView but I'm getting NotImplementedError.
I've found two other persons having the same issue: Chapter 6: NotImplemented and Why is it not available in CentOS wx.html2 . WebView control?

Code Example (click to expand)
import wx
from wx.html2 import WebView


class MyFrame(wx.Frame):
    def __init__(self, **kwargs):
        super().__init__(**kwargs)

        browser = WebView.New(self)

        self.Show()


if __name__ == "__main__":
    app = wx.App()
    frame = MyFrame(parent=None)
    app.MainLoop()
@swt2c
Copy link
Collaborator

swt2c commented Nov 17, 2021

I just answered that stackoverflow post, but here's a slightly modified response for Ubuntu:

NotImplementedError means that wxPython was compiled without wx.html2 support. The most likely cause of this on Linux is that the WebKit2 development packages were not present when you installed/compiled wxPython. To resolve this, install the WebKit2 development package and reinstall wxPython. On Ubuntu, the WebKit2 development package is libwebkit2gtk-4.0-dev, so install it with the package manager, e.g., apt install libwebkit2gtk-4.0-dev and then uninstall/reinstall wxPython. Note: you may have to also clear the pip cache so that it won't re-use the previously compiled version of wxPython.

@Patitotective
Copy link
Author

Thanks @swt2c for the answer, it worked.
(Although it took kinda 1 to build the wheel)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants