Sqlalchemy IO и операционные ошибки - PullRequest
0 голосов
/ 16 мая 2019

Я использую Ubuntu 18.04 как часть WSL (подсистема Windows для Linux). Версия python 2.7, а версия sqlalchemy 0.7, которая требуется для пакета pele pele, (https://github.com/pele-python/pele). При запуске сценариякоторый вызывает библиотеку pele, я получаю IOError из sqlalchemy.

Когда я делаю то, что предлагает предыдущая ошибка, я получаю ошибку: sqlalchemy.exc.OperationalError: (OperationalError) нет такой таблицы: tbl_minima 'ALTER TABLEtbl_minima ADD fvib FLOAT; '().

The first error is below:

Traceback (most recent call last):
  File "bh.py", line 4, in <module>
    database=system.create_database('lj17.sqlite')
  File "/home/gn203/.local/lib/python2.7/site-
packages/pele/systems/basesystem.py", line 234, in create_database
    db = Database(**kwargs)
  File "/home/gn203/.local/lib/python2.7/site-packages/pele/storage/database.py", line 432, in __init__
    self._check_schema_version()
  File "/home/gn203/.local/lib/python2.7/site-packages/pele/storage/database.py", line 477, in _check_schema_version
    "%d (%d). Please use migrate_db.py in pele/scripts to update database"%(schema, _schema_version))
IOError: database schema outdated, current (newest) version: 0 (2). Please use migrate_db.py``` 

```Second error is below:```

```lj17.sqlite
current version: 0
newest version: 2
migrating from database version 0 to 1
Traceback (most recent call last):
  File "/home/gn203/pkg/pele-master/scripts/migrate_db.py", line 63, in <module>
    migrate(dbfile)
  File "/home/gn203/pkg/pele-master/scripts/migrate_db.py", line 47, in migrate
    schema = migrate_script[schema](connection, schema)
  File "/home/gn203/pkg/pele-master/scripts/migrate_db.py", line 13, in from_0_to_1
    connection.execute("ALTER TABLE tbl_minima ADD fvib FLOAT;")
  File "/home/gn203/.local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1294, in execute
    params)
  File "/home/gn203/.local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1471, in _execute_text
    statement, parameters
  File "/home/gn203/.local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1535, in _execute_context
    context)
  File "/home/gn203/.local/lib/python2.7/site-packages/sqlalchemy/engine/base.py", line 1528, in _execute_context
    context)
  File "/home/gn203/.local/lib/python2.7/site-packages/sqlalchemy/engine/default.py", line 325, in do_execute
    cursor.execute(statement, parameters)
sqlalchemy.exc.OperationalError: (OperationalError) no such table: tbl_minima 'ALTER TABLE tbl_minima ADD fvib FLOAT;' ()```
...