Calling `praw.helpers` results in AttributeError: 'module' object has no attribute 'helpers'

1.1k Views Asked by At

I'm trying to run the code for my Reddit bot. It signs in to Reddit with no problems, but when it gets to this bit of code, it throws an error:

all_comments = praw.helpers.flatten_tree(r.get_comments('all'))

The error it throws:

AttributeError: 'module' object has no attribute 'helpers'

I have checked that the helpers file is present at A:\Python27\Lib\site-packages\praw\models\helpers.py.

1

There are 1 best solutions below

0
On

You're looking at an example for a PRAW version prior to PRAW4, however, you have PRAW4 installed.

Check out the PRAW4 documentation if you want to work with it: https://praw.readthedocs.io/en/latest/getting_started/quick_start.html