我正在尝试为我的 Reddit 机器人运行代码。它可以毫无问题地登录 Reddit,但是当它到达这段代码时,它会抛出一个错误:
all_comments = praw.helpers.flatten_tree(r.get_comments('all'))
它抛出的错误:
AttributeError: 'module' object has no attribute 'helpers'
我已经检查过帮助程序文件位于 A:\Python27\Lib\site-packages\praw\models\helpers.py
。
最佳答案
您正在查看 PRAW4 之前的 PRAW 版本的示例,但是,您已经安装了 PRAW4。
如果您想使用它,请查看 PRAW4 文档:https://praw.readthedocs.io/en/latest/getting_started/quick_start.html
关于python - 调用 `praw.helpers` 导致 AttributeError : 'module' object has no attribute 'helpers' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41176199/