I have an app written in Python using Flask that I'm deploying using Heroku. I'm running into an issue after the built, the console gives me numerous lines of error but the main one being, to me:
ImportError: cannot import name 'Binary' from 'sqlalchemy' (/app/.heroku/python/lib/python3.8/site-packages/sqlalchemy/__init__.py)
The related file begins with:
from flask_login import UserMixin
from sqlalchemy import Binary, Column, Integer, String
from app import db, login_manager
My requirement.txt file is a follow:
flask
sqlalchemy
flask_login
flask_migrate
flask_wtf
flask-sqlalchemy
email_validator
python-decouple
gunicorn
fiona
pyproj
rtree
shapely
geopandas
plotly
matplotlib
tqdm
I fail to understand the origin mainly particulalry considering that:
Does someone know where it could be coming from?
Thank you!
For posterity, I solved it by being more precise in my requirement files as follow:
flask
sqlalchemy==1.3.23
flask_login
flask_migrate
flask_wtf
flask-sqlalchemy>=2.5
email_validator
python-decouple
gunicorn
fiona
pyproj
rtree
shapely
geopandas
plotly
matplotlib
tqdm
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.