1

I am getting that error when trying to import SQLAlchemy from flask_sqlalchemy:

from flask_sqlalchemy import SQLAlchemy

The complete error message is:

  File "C:\Users\..\lib\site-packages\sqlalchemy\pool\base.py", line 63, in Pool
@util.deprecated_params(
AttributeError: module 'sqlalchemy.util' has no attribute 'deprecated_params'

The version of my libraries are sqlalchemy = 1.1.13 and flask_sqlalchemy = 2.4.0

Any suggestions on how to solve this?

Thanks

3
  • 1
    did you try to update both of them?
    – Nullman
    May 28, 2019 at 11:24
  • Thanks! that worked.. I was assuming I had the latest versions because running pip install would output that the 'requirement is already satisfied'. But after your suggestion I investigated and realized that pip install does not update the library if not explicitly requested. I updated and the issue disappeared.
    – RR_28023
    May 28, 2019 at 11:38
  • Same error here, most recent stable releases as per Pypi for today: pip freeze | grep chemy Flask-SQLAlchemy==2.4.0 SQLAlchemy==1.3.5
    – petobens
    Jun 26, 2019 at 2:24

1 Answer 1

1

Had the same error with my python env which is managed via pipenv.

I ran pipenv update sqlalchemy which strangely enough rolled back sqlalchemy's version to 1.2.19 from what I had before, which was 1.3.5.

pip freeze | grep chemy
Flask-SQLAlchemy==2.4.0
SQLAlchemy==1.2.19

This now works for me without error: python -c "from flask_sqlalchemy import SQLAlchemy"

I guess that without pipenv, one can manually use pip to re-install sqlalchemy for this specific version.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.