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

AttributeError: module 'fbchat' has no attribute 'Session' #637

Open
V35HR4J opened this issue Feb 1, 2021 · 3 comments
Open

AttributeError: module 'fbchat' has no attribute 'Session' #637

V35HR4J opened this issue Feb 1, 2021 · 3 comments

Comments

@V35HR4J
Copy link

V35HR4J commented Feb 1, 2021

AttributeError: module 'fbchat' has no attribute 'Session'
import fbchat

session = fbchat.Session.login("", "")
listener = fbchat.Listener(session=session, chat_on=False, foreground=False)

for event in listener.listen():
if isinstance(event, fbchat.MessageEvent):
print(f"{event.message.text} from {event.author.id} in {event.thread.id}")
# If you're not the author, echo
if event.author.id != session.user.id:
event.thread.send_text(event.message.text)

@alexdupat
Copy link

I have the same problem

AttributeError: module 'fbchat' has no attribute 'Session'

With the sample :

import fbchat

session = fbchat.Session.login("", "")
listener = fbchat.Listener(session=session, chat_on=False, foreground=False)

@emilwareus
Copy link

When I installed it from source it solved the problem. It seems like the Session import was removed in the packaged version of the project.

pip install git+https://github.com/carpedm20/fbchat.git

@ras5566
Copy link

ras5566 commented Mar 3, 2023

not work for me

pip install git+https://github.com/carpedm20/fbchat.git
Collecting git+https://github.com/carpedm20/fbchat.git
  Cloning https://github.com/carpedm20/fbchat.git to c:\users\223\appdata\local\temp\pip-req-build-5u3cezxc

  Running command git clone --filter=blob:none -q https://github.com/carpedm20/fbchat.git 'C:\Users\223\AppData\Local\Temp\pip-req-build-5u3cezxc'
  Resolved https://github.com/carpedm20/fbchat.git to commit 916a14062d31f3624dfe8dd4ab672648a3e508c0
  Installing build dependencies ... error
  ERROR: Command errored out with exit status 1:
   command: 'c:\users\223\appdata\local\programs\python\python38\python.exe' 'C:\Users\223\AppData\Local\Temp\pip-standalone-pip-cyshetqf\__env_pip__.zip\pip' install --ignore-installed --no-user --prefix 'C:\Users\223\AppData\Local\Temp\pip-build-env-18inqv7l\overlay' --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- flit
       cwd: None
  Complete output (1 lines):
  c:\users\223\appdata\local\programs\python\python38\python.exe: can't find '__main__' module in 'C:\\Users\\223\\AppData\\Local\\Temp\\pip-standalone-pip-cyshetqf\\__env_pip__.zip\\pip'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants