question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Import error using SQLAlchemy v1.4

See original GitHub issue

uszipcode 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:

  1. Create a fresh virtualenv
  2. Run pip install uszipcode
  3. Try to run from uszipcode import SearchEngine on the shell
  4. 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:closed
  • Created 3 years ago
  • Reactions:5
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
jlarizacommented, Mar 16, 2021

@rv-krosenberg you may run pip install SQLAlchemy==1.3.23 and use that SQLAlchemy version in your project

0reactions
MacHu-GWUcommented, Jun 8, 2021

@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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Import broken by sqlalchemy 1.4.0 · Issue #505
SQLAlchemy v1.4 is breaking verdi setup aiidateam/aiida-core#4808 ... Same issue, error with importing '_ColumnEntity'.
Read more >
SQLAlchemy v1.4 ObjectNotExecutableError when ...
As the exception message suggests, the str 'SELECT id, name FROM item LIMIT 50;' is not an executable object. To make it executable, ......
Read more >
Error Messages — SQLAlchemy 1.4 Documentation
This section lists descriptions and background for common error messages and ... As before, if these datatypes are imported from third party libraries, ......
Read more >
Overview — SQLAlchemy 1.4 Documentation
The SQLAlchemy SQL Toolkit and Object Relational Mapper is a comprehensive set of tools for working with databases and Python. It has several...
Read more >
SQLAlchemy Documentation — SQLAlchemy 1.4 ...
The new tutorial introduces both concepts in parallel. For a quick glance: ORM Quick Start - a glimpse at what working with the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found