最近使用一些从 apt 下载的应用,用python写的,安装的时候没有问题,没有提示我有依赖错误
一到运行的时候就报错了
比如我运行 kazam
WARNING Kazam - Failed to correctly detect operating system.
/usr/local/lib/python3.8/dist-packages/kazam/backend/webcam.py:24: PyGIWarning: GUdev was imported without specifying a version first. Use gi.require_version('GUdev', '1.0') before import to ensure that the right version gets loaded.
from gi.repository import GObject, GUdev
/usr/local/lib/python3.8/dist-packages/kazam/backend/gstreamer.py:35: PyGIWarning: Gst was imported without specifying a version first. Use gi.require_version('Gst', '1.0') before import to ensure that the right version gets loaded.
from gi.repository import GObject, Gst, GstVideo
/usr/local/lib/python3.8/dist-packages/kazam/backend/gstreamer.py:35: PyGIWarning: GstVideo was imported without specifying a version first. Use gi.require_version('GstVideo', '1.0') before import to ensure that the right version gets loaded.
from gi.repository import GObject, Gst, GstVideo
/usr/local/lib/python3.8/dist-packages/kazam/frontend/window_area.py:29: PyGIWarning: Wnck was imported without specifying a version first. Use gi.require_version('Wnck', '3.0') before import to ensure that the right version gets loaded.
from gi.repository import Gtk, GObject, Gdk, Wnck, GdkX11
/usr/local/lib/python3.8/dist-packages/kazam/frontend/indicator.py:149: PyGIWarning: AppIndicator3 was imported without specifying a version first. Use gi.require_version('AppIndicator3', '0.1') before import to ensure that the right version gets loaded.
from gi.repository import AppIndicator3
/usr/local/lib/python3.8/dist-packages/kazam/frontend/window_countdown.py:29: PyGIWarning: PangoCairo was imported without specifying a version first. Use gi.require_version('PangoCairo', '1.0') before import to ensure that the right version gets loaded.
from gi.repository import Gtk, GObject, GLib, Gdk, Pango, PangoCairo
(kazam:117830): Gtk-WARNING **: 16:48:19.510: Theme parsing error: gtk.css:3:0: Expected a valid selector
/usr/local/lib/python3.8/dist-packages/kazam/frontend/indicator.py:98: PyGIWarning: Keybinder was imported without specifying a version first. Use gi.require_version('Keybinder', '3.0') before import to ensure that the right version gets loaded.
from gi.repository import Keybinder
WARNING Main - No Xlib support in python3, unable to capture key and mouse clicks.
/usr/local/lib/python3.8/dist-packages/kazam/app.py:173: Warning: value "((GtkIconSize) 32)" of type 'GtkIconSize' is invalid or out of range for property 'icon-size' of type 'GtkIconSize'
self.builder.add_from_file(os.path.join(prefs.datadir, "ui", "kazam.ui"))
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/gi/overrides/Gtk.py", line 110, in _builder_connect_callback
handler, args = _extract_handler_and_args(obj_or_map, handler_name)
File "/usr/lib/python3/dist-packages/gi/overrides/Gtk.py", line 90, in _extract_handler_and_args
raise AttributeError('Handler %s not found' % handler_name)
AttributeError: Handler cb_check_cursor_pic not found
(kazam:117830): Gtk-WARNING **: 16:48:19.897: Can't set a parent on widget which has a parent
(kazam:117830): Gtk-WARNING **: 16:48:19.900: Can't set a parent on widget which has a parent
WARNING Prefs - Unable to find any audio devices.
Traceback (most recent call last):
File "/usr/bin/kazam", line 149, in <module>
app = KazamApp(datadir, dist, args.debug, args.test, args.nosound, args.silent)
File "/usr/local/lib/python3.8/dist-packages/kazam/app.py", line 354, in __init__
self.restore_UI()
File "/usr/local/lib/python3.8/dist-packages/kazam/app.py", line 1050, in restore_UI
self.chk_keypresses.set_active(prefs.capture_keys)
我也是醉了,想问下各位有没有办法构建一个独立运行的Python程序,这样运行的时候不再有错误了
草,刚才用 pyinstaller 打包程序,运行二进制文件的时候又出错了