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

使用Rasa时遭遇AttributeError错误:module 'pyparsing' has no attribute 'downcaseTokens' 求助

Fixing Rasa's "AttributeError: module 'pyparsing' has no attribute 'downcaseTokens'" Error

Hey there, let's get this frustrating Rasa issue sorted out for you! The error you're hitting boils down to a version conflict between the pyparsing library and a dependency Rasa relies on. Here's the breakdown and step-by-step fix:

The Root Cause

Your environment has a newer version of pyparsing installed, which removed the downcaseTokens method. But the oauth2client library (used by Rasa's Hangouts channel integration) still tries to call this old method, triggering the AttributeError you see in the traceback.

Step-by-Step Fix

  1. Uninstall the incompatible pyparsing version
    Run this command in your rasanew Anaconda environment:

    pip uninstall pyparsing -y
    
  2. Install a compatible older version
    Version 3.0.9 of pyparsing still includes the downcaseTokens method that oauth2client needs. Install it with:

    pip install pyparsing==3.0.9
    
  3. Test your Rasa commands again
    Now try running rasa init, rasa train, or any other Rasa command you need—they should work without throwing the error.

Extra Tip

To prevent this from happening again, pin the pyparsing version in your requirements.txt file (if you have one) by adding this line:

pyparsing==3.0.9

Here's the full error traceback you shared for reference:

Traceback (most recent call last):
  File "c:\\users\\dell\\anaconda3\\envs\\rasanew\\lib\\runpy.py", line 193, in run_module_as_main
    "__main__", mod_spec)
  File "c:\\users\\dell\\anaconda3\\envs\\rasanew\\lib\\runpy.py", line 85, in run_code
    exec(code, run_globals)
  File "C:\\Users\\Dell\\anaconda3\\envs\\rasanew\\Scripts\\rasa.exe\\__main__.py", line 7, in <module>
  File "c:\\users\\dell\\anaconda3\\envs\\rasanew\\lib\\site-packages\\rasa\\__main__.py", line 118, in main
    cmdline_arguments.func(cmdline_arguments)
  File "c:\\users\\dell\\anaconda3\\envs\\rasanew\\lib\\site-packages\\rasa\\cli\\scaffold.py", line 235, in run
    init_project(args, path)
  File "c:\\users\\dell\\anaconda3\\envs\\rasanew\\lib\\site-packages\\rasa\\cli\\scaffold.py", line 130, in init_project
    print_train_or_instructions(args, path)
  File "c:\\users\\dell\\anaconda3\\envs\\rasanew\\lib\\site-packages\\rasa\\cli\\scaffold.py", line 69, in print_train_or_instructions
    training_result = rasa.train(domain, config, training_files, output)
  File "c:\\users\\dell\\anaconda3\\envs\\rasanew\\lib\\site-packages\\rasa\\api.py", line 106, in train
    from rasa.model_training import train_async
  File "c:\\users\\dell\\anaconda3\\envs\\rasanew\\lib\\site-packages\\rasa\\model_training.py", line 39, in <module>
    from rasa.core.agent import Agent
  File "c:\\users\\dell\\anaconda3\\envs\\rasanew\\lib\\site-packages\\rasa\\core\\agent.py", line 16, in <module>
    from rasa.core.channels.channel import OutputChannel, UserMessage
  File "c:\\users\\dell\\anaconda3\\envs\\rasanew\\lib\\site-packages\\rasa\\core\\channels\\__init__.py", line 26, in <module>
    from rasa.core.channels.hangouts import HangoutsInput # noqa: F401
  File "c:\\users\\dell\\anaconda3\\envs\\rasanew\\lib\\site-packages\\rasa\\core\\channels\\hangouts.py", line 9, in <module>
    from oauth2client import client
  File "c:\\users\\dell\\anaconda3\\envs\\rasanew\\lib\\site-packages\\oauth2client\\client.py", line 39, in <module>
    from oauth2client import transport
  File "c:\\users\\dell\\anaconda3\\envs\\rasanew\\lib\\site-packages\\oauth2client\\transport.py", line 17, in <module>
    import httplib2
  File "c:\\users\\dell\\anaconda3\\envs\\rasanew\\lib\\site-packages\\httplib2\\__init__.py", line 52, in <module>
    from . import auth
  File "c:\\users\\dell\\anaconda3\\envs\\rasanew\\lib\\site-packages\\httplib2\\auth.py", line 20, in <module>
    auth_param_name = token.copy().setName("auth-param-name").addParseAction(pp.downcaseTokens)
AttributeError: module 'pyparsing' has no attribute 'downcaseTokens'

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.04.30 21:19:05