fbchat-dev / fbchat

Facebook Chat (Messenger) for Python
https://fbchat.readthedocs.io
BSD 3-Clause "New" or "Revised" License
1.18k stars 410 forks source link

MQTT connection failed #585

Open PiotrWegrzyn opened 4 years ago

PiotrWegrzyn commented 4 years ago

Description of the problem

When trying to run the echo bot example I'm getting: fbchat._exception.FBchatException: MQTT connection failed

Code to reproduce

https://fbchat.readthedocs.io/en/stable/examples.html#echobot

Traceback

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/peter/PycharmProjects/shrek_messenger/echo.py", line 22, in <module>
    client.listen()
  File "/Users/peter/PycharmProjects/shrek_messenger/venv/lib/python3.7/site-packages/fbchat/_client.py", line 2883, in listen
    self.startListening()
  File "/Users/peter/PycharmProjects/shrek_messenger/venv/lib/python3.7/site-packages/fbchat/_client.py", line 2835, in startListening
    foreground=True,
  File "/Users/peter/PycharmProjects/shrek_messenger/venv/lib/python3.7/site-packages/fbchat/_mqtt.py", line 65, in connect
    raise _exception.FBchatException("MQTT connection failed")
fbchat._exception.FBchatException: MQTT connection failed
xaadu commented 3 years ago

Have you tried the latest version? 1.9.7

DanielReyes03 commented 3 years ago

Hello, I also had that problem to solve it, what I did was use fbchat with python 2.7 because it didn't work for me with python 3.6 or 3.7 Hope I can help you 🙌🏽