LANL-Seismoacoustics / pisces

Pisces: A practical seismological database library in Python.
http://lanl-seismoacoustics.github.io/pisces/
Other
17 stars 10 forks source link

Error with sqlalchemy 1.4 #38

Closed jwebster-LANL closed 1 year ago

jwebster-LANL commented 3 years ago

Looks like there's an error when importing a new install of pisces. The newest version of sql-alchemy doesn't seem to have the sqlalchemy.ext.declarative.api module anymore

Traceback (most recent call last): File "/Users/jwebster/opt/anaconda3/envs/infrapy_env/lib/python3.6/site-packages/pisces/schema/util.py", line 9, in from sqlalchemy.ext.declarative.api import _declarative_constructor ModuleNotFoundError: No module named 'sqlalchemy.ext.declarative.api'

During handling of the above exception, another exception occurred: ... import pisces as ps File "/Users/jwebster/opt/anaconda3/envs/infrapy_env/lib/python3.6/site-packages/pisces/init.py", line 22, in from pisces.util import db_connect, get_tables, travel_times, make_table File "/Users/jwebster/opt/anaconda3/envs/infrapy_env/lib/python3.6/site-packages/pisces/util.py", line 26, in from pisces.schema.util import PiscesMeta File "/Users/jwebster/opt/anaconda3/envs/infrapy_env/lib/python3.6/site-packages/pisces/schema/util.py", line 12, in from sqlalchemy.ext.declarative import _declarative_constructor ImportError: cannot import name '_declarative_constructor'

jkmacc-LANL commented 3 years ago

It looks like SQLA 1.4 is a bridge version between 1.3 and 2.0, and has moved some things around. sqlalchemy <= 1.3.24 might work.

byoung4 commented 3 years ago

It looks like SQLA 1.4 is a bridge version between 1.3 and 2.0, and has moved some things around. sqlalchemy <= 1.3.24 might work.

I can confirm that sqlalchemy 1.3.24 works.

With a fresh installation of miniconda w/Python 3.8, the following is successful

$ conda config --add channels conda-forge
$ conda config --set channel_priority strict
$ conda update -n base -c defaults conda
$ conda create -n pisces python=3.8
$ conda activate pisces
$ pip install pisces sqlalchemy==1.3.24
$ python
>>> import pisces
jwebster-LANL commented 2 years ago

not to be a pest, but will pisces' aversion to sqlalchemy=1.4 be fixed anytime soon? A lot of packages are trying to install/upgrade to 1.4 these days, and forcing 1.3.24 is getting to be a bit of work.

jwebster-LANL commented 2 years ago

Seriously though... what would it take to get pisces to play nice with sqlalchemy 1.4? 2.0 appears to be in beta...