fede j
fede j

Reputation: 11

Using Tweepy: TypeError: get_user() takes 1 positional argument but 2 were given

api = tweepy.API(auth) 

# using get_user with id
_id = "103770785"
user = api.get_user(_id)

# printing the name of the user
print("The id " + _id + " corresponds to the user with the name : " + user.name)

That is my code. I can't find the solution for this message: TypeError: get_user() takes 1 positional argument but 2 were given

Upvotes: 0

Views: 1479

Answers (1)

Harmon758
Harmon758

Reputation: 5157

API.get_user doesn't accept any positional arguments.
The one being referred to in the error is self.
You'll want to pass _id as the user_id kwarg.
See the relevant FAQ section in Tweepy's documentation.

Upvotes: 0

Related Questions