question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError: 'Redditor' object has no attribute 'icon_img'

See original GitHub issue

Describe the Bug

I get an AttributeError while trying to use .icon_img. It had been working fine around a month ago.

Desired Result

I expected to get the URL of the user’s profile picture.

Relevant Logs

AttributeError: 'Redditor' object has no attribute 'icon_img'

Code to reproduce the bug

reddit = praw.Reddit(client_id, client_secret, user_agent)
url = reddit.redditor(username).icon_img

My code example does not include the Reddit() initialization to prevent credential leakage.

Yes

This code has previously worked as intended.

Yes

Operating System/Environment

Ubuntu 22.04.1 LTS

Python Version

Python 3.10

PRAW Version

7.6.1

Prawcore Version

2.3.0

Anything else?

No response

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
LilSpazJoekpcommented, Dec 8, 2022

And is there any immediate fix?

There is not. It is the nature of working with Reddit’s API.

1reaction
LilSpazJoekpcommented, Dec 8, 2022

What I mean by that is for example, in comments, some attributes are returned when you get the comment from a submission vs initializing them directly (which uses a different endpoint when you try and access the attribute).

Read more comments on GitHub >

github_iconTop Results From Across the Web

AttributeError: 'Redditor' object has no attribute 'icon_img'
But I am getting AttributeError: 'Redditor' object has no attribute 'icon_img'. I am using PRAW 7.6.1 with Python 3.10.
Read more >
Praw Reddit Web Crawler Error "object has no attribute"
In the Praw docs it states that these MoreComments objects are a representation of the load more comments and continue this thread links...
Read more >
Redditor — PRAW 7.6.1 documentation
This table describes attributes that typically belong to objects of this class. ... Whether or not the Redditor has active Reddit Premium status....
Read more >
Scraping Reddit data - Gilbert Tanner
Scrape data from Reddit using PRAW, the Python wrapper for the Reddit API. ... AttributeError: 'MoreComments' object has no attribute 'body'.
Read more >
comment.submission is not loaded or awaitable. #12 - GitHub
'Submission' object has not been fetched, did you forget to execute ... The Redditor object for the .author attribute is still lazily loaded...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found