Beeware Toga WebView小部件类型错误

2024-05-17 05:29:45 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试运行beeware教程

添加toga.WebView时,我在运行briefcase run -u时收到以下错误消息:

** (__main__.py:25869): WARNING **: 16:57:29.287: Failed to load shared library 'libwebkit2gtk-4.0.so.37' referenced by the typelib: /lib/x86_64-linux-gnu/libwebkit2gtk-4.0.so.37: undefined symbol: cairo_font_options_set_variations
/tmp/.mount_fubar0Ml5JP/usr/app_packages/toga_gtk/widgets/webview.py:21: Warning: cannot retrieve class for invalid (unclassed) type 'void'
  self.webview = WebKit2.WebView()
Traceback (most recent call last):
  File "/tmp/.mount_fubar0Ml5JP/usr/app_packages/toga_gtk/app.py", line 93, in gtk_startup
    self.interface.startup()
  File "/tmp/.mount_fubar0Ml5JP/usr/app/fubarr/app.py", line 32, in startup
    song=toga.WebView(url="https://stackoverflow.com")
  File "/tmp/.mount_fubar0Ml5JP/usr/app_packages/toga/widgets/webview.py", line 28, in __init__
    self._impl = self.factory.WebView(interface=self)
  File "/tmp/.mount_fubar0Ml5JP/usr/app_packages/toga_gtk/widgets/base.py", line 11, in __init__
    self.create()
  File "/tmp/.mount_fubar0Ml5JP/usr/app_packages/toga_gtk/widgets/webview.py", line 21, in create
    self.webview = WebKit2.WebView()
TypeError: could not get a reference to type class

到目前为止,我尝试的是:

  • 将pycairo降级至1.11.1
  • 只需在virtualenv中运行import toga; toga.WebView(url="https://stackoverflow.com")。。哪个有效
  • 网络搜索
  • 向意大利面怪兽祈祷

我正在使用ubuntu 19.10和python 3.7.5

谢谢你的提示


Tags: inpyselfappgtktogapackagesusr