pythonweb-frameworksnicegui

Trouble setting up nicegui


I am new to nicegui. It seems like a great framework!

When trying to setup nicegui, I am getting an error from the following setup code:

main.py:
from nicegui import ui
ui.label('Hello NiceGUI!')
ui.run()

I am in a virtual environment and imported nicegui.

Here is the top of the very long error that I received:


'int' object has no attribute 'items'

+ Exception Group Traceback (most recent call last):

| File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/starlette/_utils.py", line 82, in collapse_excgroups

| yield

| File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/starlette/middleware/base.py", line 193, in __call__

| response_sent.set()

| File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/anyio/_backends/_asyncio.py", line 678, in __aexit__

| raise BaseExceptionGroup(

| exceptiongroup.ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)

+-+---------------- 1 ----------------

| Traceback (most recent call last):

| File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/starlette/middleware/errors.py", line 164, in __call__

| await self.app(scope, receive, _send)

I tried reimporting nicegui in a virtual environment and looked at the library code, all to no avail.

Please let me know if I am missing anything!

Thank you.


Solution

  • See https://github.com/zauberzeug/nicegui/issues/2247. There was a compatibility issue with the new FastAPI 0.108.0 that had been released last night. We're about to release a bugfix in NiceGUI 1.4.8.