Beeware Toga WebView小部件TypeError

问题描述

我正在尝试运行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
  • 只需在虚拟环境中运行import toga; toga.WebView(url="https://stackoverflow.com")。.
  • 网络搜索
  • 为意大利面条怪物祈祷

我正在使用ubuntu 19.10和python 3.7.5。

感谢任何提示

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)