Partially initialized module 'webview' has no attribute 'create_window' (most likely due to a circular import) error on Linux
Closed this issue · 3 comments
Specification
- pywebview version: 5.1
- operating system: Linux, Ubuntu Studio (Ubuntu-based), KDE Plasma 5, X11 graphical server
- web renderer: webkit
Description
Describe your issue in details. Provide a stand-alone code example that would demonstrate the problem.
When I try to run example code, it shows me this error:
Traceback (most recent call last):
File "/usr/lib/python3.10/idlelib/run.py", line 578, in runcode
exec(code, self.locals)
File "/home/myroslav/webview.py", line 1, in
import webview
File "/home/myroslav/webview.py", line 7, in
window = webview.create_window('Woah dude!', htm='Woah dude!')
AttributeError: partially initialized module 'webview' has no attribute 'create_window' (most likely due to a circular import)
My code:
import webview
def custom_logic(window):
window.toggle_fullscreen()
window.evaluate_js('alert("Nice one brother")')
window = webview.create_window('Woah dude!', htm='Woah dude!')
webview.start(custom_logic, window)
#(comment) anything below this line will be executed after program is finished executing
pass
Practicalities
-
YES/NO I am willing to work on this issue myself. NO
-
YES/NO I am prepared to support this issue financially.NO
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
The message to post on the issue when closing it. If none provided, will not comment when closing an issue.