Jacob-Stevens-Haas / tehom

Machine Learning on Underwater Acoustics
GNU Affero General Public License v3.0
3 stars 0 forks source link

sqlalchemy.exc.ArgumentError: expected schema argument to be a string, got <class 'sqlalchemy.engine.base.Engine'>. #25

Open lizeyujack opened 1 year ago

lizeyujack commented 1 year ago

Dear authors of tehom, I have trouble in downloading onc data by running python -m tehom ships 2016 6 9 It raised:

ais db /home/lizeyu/oceandil/tehom/tehom/storage/ais.db
Traceback (most recent call last):
  File "/home/lizeyu/anaconda3/envs/efficientleaf/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/lizeyu/anaconda3/envs/efficientleaf/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/lizeyu/oceandil/tehom/tehom/__main__.py", line 3, in <module>
    __main__()
  File "/home/lizeyu/oceandil/tehom/tehom/__init__.py", line 59, in __main__
    subcommand(**vars(args))
  File "/home/lizeyu/oceandil/tehom/tehom/downloads.py", line 73, in download_ships
    _persistence.init_ais_db(ais_db)
  File "/home/lizeyu/oceandil/tehom/tehom/_persistence.py", line 124, in init_ais_db
    md = MetaData(eng)
  File "/home/lizeyu/anaconda3/envs/efficientleaf/lib/python3.8/site-packages/sqlalchemy/sql/schema.py", line 5440, in __init__
    raise exc.ArgumentError(
sqlalchemy.exc.ArgumentError: expected schema argument to be a string, got <class 'sqlalchemy.engine.base.Engine'>.

Cause I am not very good at coding with python to query sql db. Do you have any idea how can I solve it? Looking forward to your reply.

Jack Li

Jacob-Stevens-Haas commented 1 year ago

Hey Jack, thanks for the issue! Can you share your version of sqlalchemy? It looks like it had a backwards-incompatible new release in January.

If you're on sqlalchemy 2.0.x, try pip install sqlalchemy<2.0 and see if the error persists.