Catch ImportError (#2526)
This commit is contained in:
parent
3246b58437
commit
c1798dbe1f
1 changed files with 7 additions and 2 deletions
|
@ -4,8 +4,13 @@ import argparse
|
|||
import os.path
|
||||
import sqlite3
|
||||
import sys
|
||||
from sqlalchemy import create_engine
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
try:
|
||||
from sqlalchemy import create_engine
|
||||
from sqlalchemy.orm import sessionmaker
|
||||
except ImportError:
|
||||
print('Fatal Error: SQLAlchemy is missing. Install it with '
|
||||
'"pip3 install SQLAlchemy" before running this script')
|
||||
sys.exit(1)
|
||||
from homeassistant.components.recorder import models
|
||||
import homeassistant.config as config_util
|
||||
import homeassistant.util.dt as dt_util
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue