ImportError: cannot import name 'URL' from 'sqlalchemy.engine'

When train model from anaconda i am getting this error 'ImportError: cannot import name 'URL' from 'sqlalchemy.engine'

> Traceback (most recent call last): > File “c:\users\namen\anaconda3\lib\runpy.py”, line 194, in _run_module_as_main > return _run_code(code, main_globals, None, > File “c:\users\name\anaconda3\lib\runpy.py”, line 87, in _run_code > exec(code, run_globals) > File “C:\Users\name\anaconda3\Scripts\rasa.exe_main_.py”, line 7, in > File “c:\users\name\anaconda3\lib\site-packages\rasa_main_.py”, line 121, in main > cmdline_arguments.func(cmdline_arguments) > File “c:\users\namen\anaconda3\lib\site-packages\rasa\cli\train.py”, line 59, in > train_parser.set_defaults(func=lambda args: run_training(args, can_exit=True)) > File “c:\users\name\anaconda3\lib\site-packages\rasa\cli\train.py”, line 91, in run_training > training_result = train_all( > File “c:\users\name\anaconda3\lib\site-packages\rasa\api.py”, line 103, in train > from rasa.model_training import train > File “c:\users\name\anaconda3\lib\site-packages\rasa\model_training.py”, line 17, in > from rasa.engine.caching import LocalTrainingCache > File “c:\users\name\anaconda3\lib\site-packages\rasa\engine\caching.py”, line 13, in > from sqlalchemy.engine import URL > ImportError: cannot import name ‘URL’ from ‘sqlalchemy.engine’

  • Rasa Version : 3.0.0
  • Minimum Compatible Version: 3.0.0
  • Rasa SDK Version : 3.0.0
  • Rasa X Version : None
  • Python Version : 3.8.8
  • Operating System : Windows-10

Please help for solve this issue

@MNR try install pip3 install flask-sqlalchemy or pip3 install flask-sqlalchemy --user, even you can try conda install flask-sqlalchemy

1 Like

Look for a higher version of SQLAlchemy

1 Like

Hi, Thanks for the reply. I tried both commands but still got this error. :roll_eyes:

@MNR what is the issue now?