Import error using SQLAlchemy v1.4
See original GitHub issueuszipcode requires sqlalchemy as a dependency; but no version is specified so it will always install the latest version.
SQLAlchemy==1.4 was released yesterday. One of the changes is that
from sqlalchemy.ext.declarative.api import DeclarativeMeta
used on uszipcode-project/uszipcode/pkg/sqlalchemy_mate/pt.py raises an import error. However, on uszipcode it is being ignored by a try except call.
So, a fresh install of uszipcode will produce a ImportError: cannot import name 'SearchEngine' when trying to import the SearchEngine.
To Reproduce
Steps to reproduce the behavior:
- Create a fresh virtualenv
- Run
pip install uszipcode - Try to run
from uszipcode import SearchEngineon the shell - See error
Expected behavior
It should raise a versions error or something more telling; the try except being used on uszipcode-project/uszipcode/pkg/sqlalchemy_mate/__init__.py is reducing the obtained feedback and it may be confusing to new users.
Thank you,
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:15 (6 by maintainers)

Top Related StackOverflow Question
@rv-krosenberg you may run
pip install SQLAlchemy==1.3.23and use that SQLAlchemy version in your project@aaronsmith1234 by the way, I made this compatible to sqlalchemy<1.4 as well by adding a try, catch around your code. Thank you for your contribution