I installed Tweepy correctly, I put the right tokens, even regenerated it to see if that resolved the problem but still I can’t find a solution.

Do you have spaces or some other extra characters accidentally pasted in the access tokens? Also check your system clock is in sync with NTP because that affects authentication.

I have copied the tokens directly from the page that provided it for me, although in my code in the access token there’s a “%”, I don’t know if that affects my code. The system clock in sync with NTP, how can I check that?

in my code in the access token there’s a “%”

Ah, that might be it - access tokens should only have numbers, letters and and a dash -, like:

access_token = "12345-AbcDeF"

To check if your system clock is in sync depends entirely on what OS you have, the place i always go to to get some specific commands to run is https://superuser.com/

But I copied directly from the site, and there’s no error in that. Also, I have already sync the system clock with NTP, still getting errors. I get errors when I try to actually print some action, in the code in the screenshot that I submitted, I don’t get errors until line 13. Line 1 to 12 doesn’t have errors.

Oh, in that case i’m not really sure what else could be wrong.

Does

api.verify_credentials()

work? If not, there may still be a problem with the keys (i still suspect there’s something in between copy pasting them, or something like a space at the beginning or end?)

Also resetting keys invalidates old ones, and sometimes it takes a minute or two for new ones to work.

Well, I copy paste them correctly. I actually have regenerate them a couple of times and still no luck. I did run that code that verifies credentials and got the same error code. Sadly, I think there’s nothing more to try. Thanks for trying to help.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.