fbchat-dev / fbchat-dev/fbchat
Attributes of fbchat "not existing"
- Dominant language
- Python
- Stars
- 1.2k
- Forks
- 403
- PR merge metrics
- No merged PRs in 30d
Description
(im REALLY new so im just gonna edit the template and not delete it and go from scratch i guess)
## Description of the problem
I can import fbchat seemingly fine, and pip is cool now, but as soon as i try to run the following code, it will return an AttributeError statement about fbchat.Client. I also had to fix the given code to change raw_input() to input() for some reason? (that was the original error--not recognizing raw_input() as a keyword)
## Code
```
>>> from fbchat import Client
Username: [my username]
```
OR
```
import fbchat
from getpass import getpass
username = str(input("Username: "))
client = fbchat.Client(username, getpass())
no_of_friends = int(input("Number of friends: "))
for i in xrange(no_of_friends):
name = str(input("Name: "))
friends = client.searchForUsers(name) # return a list of names
friend = friends[0]
msg = str(input("Message: "))
sent = client.sendMessage(msg, thread_id=friend.uid)
if sent:
print("Message sent successfully!")
```
what i get in return:
```
Traceback (most recent call last):
File "D:/Python/Attempts/fbchat.py", line 1, in
import fbchat
File "D:/Python/Attempts\fbchat.py", line 4, in
client = fbchat.Client(username, getpass())
AttributeError: partially initialized module 'fbchat' has no attribute 'Client' (most likely due to a circular import)
```
## Environment information
- Python version: 3.8.5
- `fbchat` version: v1
Contributor guide
Assessment
This issue has not been assessed yet.