python - 调用 `praw.helpers` 导致 AttributeError : 'module' object has no attribute 'helpers'

标签 python praw reddit

我正在尝试为我的 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/

相关文章:

python - heroku python3 : ImportError: No module named 'encodings'

python - 使用标准 python 库输入 ssh 密码(不是 pexpect)

Python:如果包含特定属性值,则从命名元组列表中获取条目

python - 在 Python 中处理超时异常

python - 虾属性错误 : 'NoneType' object has no attribute 'get_comments'

python - 不和谐、粗暴、阻塞

python - PRAW 不理解之后的关键字参数

python - python logging 会取代 print 吗?

python - 如何根据 Pandas 中的依赖值更新数据框?

java - 在 Android 上解析时,Json 值返回空(如果不是)