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

ModuleNotFoundError: No module named 'gi' #1390

Closed
aes219 opened this issue May 22, 2024 · 2 comments
Closed

ModuleNotFoundError: No module named 'gi' #1390

aes219 opened this issue May 22, 2024 · 2 comments

Comments

@aes219
Copy link

aes219 commented May 22, 2024

Specification

  • pywebview version: 5.1
  • operating system: Ubuntu 24.04 LTS
  • web renderer: webkit2gtk-4.1

Description

I receive the following error when trying to run the basic setup of pywebview. I already have python3-gi, libweb2kitgtk-4.1-0, libweb2kitgtk-4.1-dev and libweb2kitgtk-4.1 installed. I also have all the other dependencies installed.

[pywebview] GTK cannot be loaded
Traceback (most recent call last):
  File "/media/vaidik/Projects/aegis/.venv/lib/python3.12/site-packages/webview/guilib.py", line 37, in import_gtk
    import webview.platforms.gtk as guilib
  File "/media/vaidik/Projects/aegis/.venv/lib/python3.12/site-packages/webview/platforms/gtk.py", line 21, in <module>
    import gi
ModuleNotFoundError: No module named 'gi'
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.

Aborted (core dumped)
@aes219 aes219 changed the title ModuleNotFoundError: No module named 'gi ModuleNotFoundError: No module named 'gi' May 22, 2024
@ZhaoZuohong
Copy link

It seems that you are using a virtual environment. Does installing pycairo and PyGObject pip install pycairo PyGObject help?

@aes219
Copy link
Author

aes219 commented May 22, 2024

It seems that you are using a virtual environment. Does installing pycairo and PyGObject pip install pycairo PyGObject help?

That fixed it! Thanks for the help.

@aes219 aes219 closed this as completed May 22, 2024
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