Flask-Migrate version compatibile with Flask-SQLAlchemy==2.3.2 and SQLAlchemy==1.2.15

292 views Asked by At

When installing Flask-Migrate using pip, it updates SQLAlchemy and some other dependencies and then app wont even start.

I have installed:

Flask-SQLAlchemy==2.3.2 SQLAlchemy==1.2.15

I tried latest version of Flask-Migrate, I tried versions from 2.4.0 to 3.0.0 and neither one is working.

What version will work with those dependencies?

This is my whole requirements.txt:

aiohttp==3.8.5
aiosignal==1.3.1
asn1crypto==0.24.0
astroid==2.1.0
async-timeout==4.0.3
asynctest==0.13.0
attrs==23.1.0
bcrypt==3.1.5
beautifulsoup4==4.12.2
blinker==1.4
certifi==2023.7.22
cffi==1.11.5
charset-normalizer==3.2.0
Click==7.0
colorama==0.4.1
cryptography==2.5
Flask==1.0.2
Flask-Bcrypt==0.7.1
Flask-Login==0.4.1
Flask-Mail==0.9.1
Flask-SQLAlchemy==2.3.2
Flask-User==1.0.1.5
Flask-WhooshAlchemy==0.56
Flask-WTF==0.14.2
flaskfilemanager==0.0.6
frozenlist==1.3.3
geoip2==4.7.0
idna==3.4
importlib-metadata==6.7.0
IPy==1.1
isort==4.3.4
itsdangerous==1.1.0
Jinja2==2.10
lazy-object-proxy==1.3.1
littlefish==0.0.75
lxml==4.9.3
MarkupSafe==1.1.0
maxminddb==2.4.0
mccabe==0.6.1
multidict==6.0.4
passlib==1.7.1
Pillow==5.3.0
pycparser==2.19
pylint==2.2.2
pylint-flask==0.5
pylint-plugin-utils==0.4
PyMarkovChain==1.8
PyMySQL==1.1.0
python-dateutil==2.8.2
pytz==2023.3
PyYAML==6.0.1
requests==2.31.0
six==1.12.0
soupsieve==2.4.1
SQLAlchemy==1.2.15
typing_extensions==4.7.1
urllib3==2.0.4
Werkzeug==0.14.1
Whoosh==2.7.4
wrapt==1.10.11
WTForms==2.2.1
yarl==1.9.2
zipp==3.15.0

Thank you in advance!

1

There are 1 answers

0
Miguel Grinberg On

The most sensible approach to solve your problem is to upgrade your project to work with latest versions of SQLAlchemy and Flask-SQLAlchemy, and then add Flask-Migrate. If you want to keep your old dependencies then you'll need to install an old Flask-Migrate (from around the time of your project), then uninstall any newer dependencies that are upgraded and reinstall their old versions. It will take some trial and error until everything works, so I would not recommend this approach.