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

Traceback (most recent call last): File "index.py", line 1, in <module> ModuleNotFoundError: No module named 'webview' #1

Open
BaseMax opened this issue Sep 8, 2024 · 8 comments
Assignees

Comments

@BaseMax
Copy link
Member

BaseMax commented Sep 8, 2024

Traceback (most recent call last):
File "index.py", line 1, in
ModuleNotFoundError: No module named 'webview'

image

@BaseMax BaseMax self-assigned this Sep 8, 2024
@BaseMax
Copy link
Member Author

BaseMax commented Sep 8, 2024

image

@tikrack
Copy link
Member

tikrack commented Sep 8, 2024

خب این نیاز به یک پکیج داره
باید نصب کنین
پای اینستالر هم باید نصب بشه

@BaseMax
Copy link
Member Author

BaseMax commented Sep 8, 2024

لطفا نام پکیج رو بفرستید.

با زدن دستور
pip install -r requirements.txt

پکیج های مورد نیاز باید نصب بشه من فایل اش رو ساختم
اگه پکیجی هست به فایل اضافه کنید

https://github.com/SalamLang/Salam-Desktop/blob/main/requirements.txt

@tikrack
Copy link
Member

tikrack commented Sep 8, 2024

نمیدونم اخه چی بود
دنبالش میگردم پیدا کردم خبرتون میکنم

@BDadmehr0
Copy link
Member

BDadmehr0 commented Oct 14, 2024

شاید کمکی بکند : Nuitka/Nuitka#2231 و r0x0r/pywebview و modulenotfounderror-no-module-named-view

@BaseMax
Copy link
Member Author

BaseMax commented Oct 14, 2024

Hi @BDadmehr0,

Thank you so much for your suggestion and the resources you shared! We really appreciate your input. If you're interested, we'd love to have you work on this issue with us. Your help would be invaluable to the project!

Best wishes,
Max

@BDadmehr0
Copy link
Member

I was trying to run the program when I encountered this error:

➜  Salam-Desktop-main python index.py 
[pywebview] GTK cannot be loaded
Traceback (most recent call last):
  File "/home/dadmehr/.pyenv/versions/3.12.6/lib/python3.12/site-packages/webview/guilib.py", line 37, in import_gtk
    import webview.platforms.gtk as guilib
  File "/home/dadmehr/.pyenv/versions/3.12.6/lib/python3.12/site-packages/webview/platforms/gtk.py", line 21, in <module>
    import gi
ModuleNotFoundError: No module named 'gi'
[pywebview] QT cannot be loaded
Traceback (most recent call last):
  File "/home/dadmehr/.pyenv/versions/3.12.6/lib/python3.12/site-packages/webview/guilib.py", line 49, in import_qt
    import webview.platforms.qt as guilib
  File "/home/dadmehr/.pyenv/versions/3.12.6/lib/python3.12/site-packages/webview/platforms/qt.py", line 24, in <module>
    from qtpy import QtCore
ModuleNotFoundError: No module named 'qtpy'
Traceback (most recent call last):
  File "/home/dadmehr/Documents/GitHub/Salam-Desktop-main/index.py", line 30, in <module>
    webview.start()
  File "/home/dadmehr/.pyenv/versions/3.12.6/lib/python3.12/site-packages/webview/__init__.py", line 166, in start
    guilib = initialize(gui)
             ^^^^^^^^^^^^^^^
  File "/home/dadmehr/.pyenv/versions/3.12.6/lib/python3.12/site-packages/webview/guilib.py", line 124, in initialize
    raise WebViewException(
webview.errors.WebViewException: You must have either QT or GTK with Python extensions installed in order to use pywebview.

And it seems to have a general solution

I would like to start by preventing this strange error from showing up. It would be better to implement error handling so that instead of an error, it prints a solution.

@BaseMax
Copy link
Member Author

BaseMax commented Oct 14, 2024

@mohamadreza1388 built and tested this repository on a Windows laptop.

If it's too complex and hard - we can build the webview software based on Qt Widgets, I guess all these errors will be solved and Qt will handle all operating systems.

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

3 participants