You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello flet community, I am using Flet for the first time on my M1 Mac with OSX Ventura 13.4 and I am having trouble with accessing the attributes of ft.Page.pubsub. To show this is not just a user error, I copy and pasted an exact example code for pubsub from the website directly into a python file and ran it, but it still produces the has no attribute error. Everything else in the library seems to work fine. I just can't access pubsub. My python is 3.11.3 and everything from flet installed fine besides the error below, but I've tried to uninstall and reinstall different version of httpx and it only adds more errors. If anyone can help me I would really appreciate it.
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
argilla 1.8.0 requires httpx<0.24,>=0.15, but you have httpx 0.24.1 which is incompatible.
Code sample
importfletasftdefmain(page: ft.Page):
page.title="Flet Chat"# subscribe to broadcast messagesdefon_message(msg):
messages.controls.append(ft.Text(msg))
page.update()
page.pubsub.subscribe(on_message)
defsend_click(e):
page.pubsub.send_all(f"{user.value}: {message.value}")
# clean up the formmessage.value=""page.update()
messages=ft.Column()
user=ft.TextField(hint_text="Your name", width=150)
message=ft.TextField(hint_text="Your message...", expand=True) # fill all the spacesend=ft.ElevatedButton("Send", on_click=send_click)
page.add(messages, ft.Row(controls=[user, message, send]))
ft.app(target=main, view=ft.AppView.WEB_BROWSER)
Error message
Unhandled error processing page session a7e06b49-0f9a-4457-878f-9e95c017c3a1: Traceback (most recent call last):
File "/Users/philipm614/opt/anaconda3/envs/NuclGpt/lib/python3.11/site-packages/flet_runtime/app.py", line 357, in on_session_created
session_handler(page)
File "/Users/philipm614/AcademiaGPT/test.py", line 11, in main
page.pubsub.subscribe(on_message)
^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'PubSub' object has no attribute 'subscribe'
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Question
Hello flet community, I am using Flet for the first time on my M1 Mac with OSX Ventura 13.4 and I am having trouble with accessing the attributes of ft.Page.pubsub. To show this is not just a user error, I copy and pasted an exact example code for pubsub from the website directly into a python file and ran it, but it still produces the has no attribute error. Everything else in the library seems to work fine. I just can't access pubsub. My python is 3.11.3 and everything from flet installed fine besides the error below, but I've tried to uninstall and reinstall different version of httpx and it only adds more errors. If anyone can help me I would really appreciate it.
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
argilla 1.8.0 requires httpx<0.24,>=0.15, but you have httpx 0.24.1 which is incompatible.
Code sample
Error message
------------------------------------------------------
Beta Was this translation helpful? Give feedback.
All reactions