ImportError: cannot import name exceptions FLASK - Python -
i'm working sqlite , flask in python. problem i'm trying create database error "importerror: cannot import name exceptions".
python db_create.py
db_create.py
#!flask/bin/python migrate.versioning import api config import sqlalchemy_database_uri config import sqlalchemy_migrate_repo app import db import os.path db.create_all() if not os.path.exists(sqlalchemy_migrate_repo): api.create(sqlalchemy_migrate_repo, 'database repository') api.version_control(sqlalchemy_database_uri, sqlalchemy_migrate_repo) else: api.version_control(sqlalchemy_database_uri, sqlalchemy_migrate_repo, api.version(sqlalchemy_migrate_repo))
error
traceback (most recent call last): file "db_create.py", line 2, in <module> migrate.versioning import api file "/home/desarrollo3/.local/lib/python2.7/site-packages/migrate/versioning/api.py", line 33, in <module> migrate.versioning import (repository, schema, version, file "/home/desarrollo3/.local/lib/python2.7/site-packages/migrate/versioning/schema.py", line 10, in <module> sqlalchemy import exceptions sa_exceptions importerror: cannot import name exceptions
to fix issue, had install sqlalchemy-migrate package:
pip install sqlalchemy-migrate
Comments
Post a Comment