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

Native mode raises 'webview' has not attribute 'settings' #3135

Closed
miek770 opened this issue May 28, 2024 · 1 comment
Closed

Native mode raises 'webview' has not attribute 'settings' #3135

miek770 opened this issue May 28, 2024 · 1 comment
Labels
bug Something isn't working
Milestone

Comments

@miek770
Copy link
Contributor

miek770 commented May 28, 2024

Description

I'm trying to run the following minimal example but it fails:

from nicegui import ui

ui.label("Hi")

ui.run(native=True)

The error is (no window opened):

$ py main.py 
NiceGUI ready to go on http:https://localhost:8001
Process Process-1:
Traceback (most recent call last):
  File "C:\Users\username\AppData\Local\Programs\Python\Python311\Lib\multiprocessing\process.py", line 314, in _bootstrap
    self.run()
  File "C:\Users\username\AppData\Local\Programs\Python\Python311\Lib\multiprocessing\process.py", line 108, in run   
    self._target(*self._args, **self._kwargs)
  File "C:\Users\username\AppData\Local\Programs\Python\Python311\Lib\site-packages\nicegui\native\native_mode.py", line 45, in _open_window
    webview.settings.update(**core.app.native.settings)
    ^^^^^^^^^^^^^^^^
AttributeError: module 'webview' has no attribute 'settings'

I'm using:

  • Python 3.11.4 64-bit
  • nicegui 1.4.26
  • pywebview 4.2.2

It used to work for me but I must have upgraded nicegui since then; I don't remember which version I was using.


Tried manually upgrading pywebview to version 5.1, which resolved the issue (the expected window appeared with no error).

@miek770 miek770 changed the title Native mode raises webview has not attribute settings Native mode raises 'webview' has not attribute 'settings' May 28, 2024
@falkoschindler
Copy link
Contributor

Hi @miek770,

Thanks for reporting this issue! It looks like the settings dictionary has only been introduced in pywebview 5.0. So we should bump its version in our pyproject.toml.

@falkoschindler falkoschindler added the bug Something isn't working label May 28, 2024
@falkoschindler falkoschindler added this to the 1.4.27 milestone May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants