2017-02-14 4 views
1

Windowsで動作しているPythonアプリケーションを実装しました。 私はMac OS Sierraでアプリケーションを実行したいと思います。sqlite3.ConnectionオブジェクトにMACの属性 'enable_load_extension'がありません

私のアプリはSQLAlchemyライブラリを使用しています。

私はクラスが私のDB接続を表してい:私は、Mac OS用のアナコンダをインストールし、まだに沿って

AttributeError: 'sqlite3.Connection' object has no attribute 'enable_load_extension' 

:アプリは、私は次のエラーを得た実行されている場合

class DB(): 
''' 
Represents the primary blackboard of the system. 
''' 

def __init__(self): 
    pass 

def setUp(self): 
    # read config 
    configInst = getConfig() 
    self._date = getConfig().eval(self.__class__.__name__, "start_date") 
    self.Session = sessionmaker() 
    self.Session.configure(bind=self.engine) 

    self.session = self.Session() 

    @event.listens_for(self.engine, "connect") 
    def connect(dbapi_connection, connection_rec): 
      dbapi_connection.enable_load_extension(True) 
    if(getConfig().eval("OperatingSystem","windows")): 
       dbapi_connection.execute('SELECT load_extension("%s%s")'%(configInst.get("DB","DB_path_to_extension"),'.dll')) 
    if(getConfig().eval("OperatingSystem","mac")): 
     dbapi_connection.execute('SELECT load_extension("%s%s")'%(configInst.get("DB","DB_path_to_extension"),'.dylib')) 

      **dbapi_connection.enable_load_extension(False)** 
    if getConfig().eval(self.__class__.__name__,"dropall_on_setup"): 
     Base.metadata.drop_all(self.engine) 

    Base.metadata.create_all(self.engine) 
    pass 

を**アプリケーションはsqlite3.pyファイルにアクセスできません。

リンクできません。

誰か?

+0

Pythonのバージョン? –

答えて

0

これが修正されました。アナコンダをアップデートしてみてください!

関連する問題