diff --git a/mythril/ethereum/interface/leveldb/eth_db.py b/mythril/ethereum/interface/leveldb/eth_db.py index a296f696..1391c1a4 100644 --- a/mythril/ethereum/interface/leveldb/eth_db.py +++ b/mythril/ethereum/interface/leveldb/eth_db.py @@ -1,13 +1,23 @@ """This module contains the ETH_DB class, which the base database used by pyethereum.""" -import plyvel + from ethereum.db import BaseDB +has_plyvel = True +try: + import plyvel +except ImportError: + has_plyvel = False + class ETH_DB(BaseDB): """Adopts pythereum BaseDB using plyvel.""" def __init__(self, path): + if has_plyvel is False: + raise ImportError( + "Plyvel is not installed, please install plyvel and leveldb" + ) self.db = plyvel.DB(path) def get(self, key):