Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build currently fails on SQLAlchemy error #30

Open
DGaffney opened this issue Apr 16, 2021 · 0 comments
Open

Build currently fails on SQLAlchemy error #30

DGaffney opened this issue Apr 16, 2021 · 0 comments

Comments

@DGaffney
Copy link

When running docker-compose build & docker-compose up from the zipfile on a mac, I run into the following issue:

app         | Traceback (most recent call last):
app         |   File "manage.py", line 3, in <module>
app         |     from api import create_app
app         |   File "/app/api/__init__.py", line 7, in <module>
app         |     from sqlalchemy_utils import create_database, database_exists
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy_utils/__init__.py", line 1, in <module>
app         |     from .aggregates import aggregated  # noqa
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy_utils/aggregates.py", line 372, in <module>
app         |     from .functions.orm import get_column_key
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy_utils/functions/__init__.py", line 1, in <module>
app         |     from .database import (  # noqa
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy_utils/functions/database.py", line 10, in <module>
app         |     from ..expressions import explain_analyze
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy_utils/expressions.py", line 4, in <module>
app         |     from sqlalchemy.sql.expression import (
app         | ImportError: cannot import name '_literal_as_text' from 'sqlalchemy.sql.expression' (/usr/local/lib/python3.7/site-packages/sqlalchemy/sql/expression.py)
app         | Traceback (most recent call last):
app         |   File "manage.py", line 3, in <module>
app         |     from api import create_app
app         |   File "/app/api/__init__.py", line 7, in <module>
app         |     from sqlalchemy_utils import create_database, database_exists
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy_utils/__init__.py", line 1, in <module>
app         |     from .aggregates import aggregated  # noqa
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy_utils/aggregates.py", line 372, in <module>
app         |     from .functions.orm import get_column_key
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy_utils/functions/__init__.py", line 1, in <module>
app         |     from .database import (  # noqa
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy_utils/functions/database.py", line 10, in <module>
app         |     from ..expressions import explain_analyze
app         |   File "/usr/local/lib/python3.7/site-packages/sqlalchemy_utils/expressions.py", line 4, in <module>
app         |     from sqlalchemy.sql.expression import (
app         | ImportError: cannot import name '_literal_as_text' from 'sqlalchemy.sql.expression' (/usr/local/lib/python3.7/site-packages/sqlalchemy/sql/expression.py)

Looks like this happens on the line:

from sqlalchemy_utils import create_database, database_exists

In api/__init__.py. The solution appears to be to update requirements.txt with the following change:

sqlalchemy<1.4.0

According to this StackOverflow discussion: https://stackoverflow.com/questions/66644975/importerror-cannot-import-name-columnentity-from-sqlalchemy-orm-query

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant