You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

源码安装twint 2.1.21后Jupyter Notebook报无Config属性错误

安装环境说明
  • 通过源码拉取方式执行安装命令如下:
git clone --depth=1 https://github.com/twintproject/twint.git
cd twint
pip3 install . -r requirements.txt
  • 安装全程无报错,终端提示成功安装twint-2.1.21版本
  • 在系统命令提示符(cmd.exe)中调用twint执行Twitter推文爬取任务,功能运行正常
异常报错情况
  • 在Jupyter Notebook中运行测试代码时,触发模块属性缺失类报错,完整报错栈为:
AttributeError                            Traceback (most recent call last)
<ipython-input-6-f48dbefa5025> in <module>
      1 # 配置爬取参数
----> 2 c = twint.Config()
      3 c.Search = "wfh"
      4 
      5 # 启动爬取任务

AttributeError: module 'twint' has no attribute 'Config'
Jupyter中执行的测试代码
import twint
# 配置爬取参数
c = twint.Config()
c.Search = "wfh"

# 启动爬取任务
twint.run.Search(c)

内容的提问来源于stack exchange,提问作者potatos

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.10.25 06:15:06