havok2063 / boolean_parser

python package for parsing a string with boolean logic
https://boolean-parser.readthedocs.io/en/latest/index.html
BSD 3-Clause "New" or "Revised" License
14 stars 7 forks source link

ModuleNotFoundError: No module named 'sqlalchemy.ext.declarative.api' #3

Closed muxevola closed 3 years ago

muxevola commented 3 years ago

Hi!

I get the above error when I try to import the parse function as indicated in the docs:

>>> from boolean_parser import parse

Traceback:

---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-25-9aac25771e6f> in <module>
----> 1 from boolean_parser.parsers import base

~\miniconda3\envs\hv38\lib\site-packages\boolean_parser\__init__.py in <module>
     14 from __future__ import print_function, division, absolute_import
     15 
---> 16 from boolean_parser.parsers import Parser
     17 from boolean_parser.parsers import SQLAParser
     18 

~\miniconda3\envs\hv38\lib\site-packages\boolean_parser\parsers\__init__.py in <module>
     14 from __future__ import print_function, division, absolute_import
     15 from .base import Parser
---> 16 from .sqla import SQLAParser
     17 

~\miniconda3\envs\hv38\lib\site-packages\boolean_parser\parsers\sqla.py in <module>
     14 from __future__ import print_function, division, absolute_import
     15 from boolean_parser.parsers import Parser
---> 16 from boolean_parser.mixins import SQLAMixin
     17 from boolean_parser.actions.clause import Condition
     18 from boolean_parser.actions.boolean import BaseBool, BoolNot, BoolAnd, BoolOr

~\miniconda3\envs\hv38\lib\site-packages\boolean_parser\mixins\__init__.py in <module>
----> 1 from boolean_parser.mixins.sqla import SQLAMixin

~\miniconda3\envs\hv38\lib\site-packages\boolean_parser\mixins\sqla.py in <module>
     16 import decimal
     17 from sqlalchemy import func, bindparam
---> 18 from sqlalchemy.ext.declarative.api import DeclarativeMeta
     19 from sqlalchemy.orm.util import AliasedClass
     20 from sqlalchemy.dialects import postgresql

ModuleNotFoundError: No module named 'sqlalchemy.ext.declarative.api'
muxevola commented 3 years ago

The error is gone after downgrading sqlalchemy from v1.4.15 to v1.3.13.

havok2063 commented 3 years ago

Thanks @muxevola. Yeah I haven't been able to fully test it against sqlalchemy 1.4 but I guess I should since that's the default that will get installed. I will try to update to 1.4 but if if not, I'll pin the dependency req.

havok2063 commented 3 years ago

Closing this. This was fixed in #4 .