pythonpython-3.xauthenticationredditpraw

can't login using praw. already checked the credentials


import praw

hey = praw.Reddit(
    client_id="",
    client_secret="",
    user_agent="my user agent",
    user_name="",
    password=""
) 
print(hey.user.me())
hey.subreddit("AskMen").subscribe()

double checked all the crediantials but still getting this error.

And in the output console only "none" is printed

praw.exceptions.RedditAPIException: USER_REQUIRED: 'Please log in to do that.'

Solution

  • The main problem was in the statement of "user_name". It should be username not user_name.