環境
Windows10 pro
Python3.9
Anaconda3
VSCode
Sqlite3
以下のコードを実行した。
````
import sqlalchemy
import sqlalchemy.ext.declarative
import sqlalchemy.orm
engine = sqlalchemy.create_engine('sqlite:///:memory:')
Base = sqlalchemy.ext.declarative.declarative_base()
class Person(Base):
__tablename__ = 'persons'
id = sqlalchemy.Column(
sqlalchemy.Integer, primary_key=True, autoincrement=True)
name = sqlalchemy.Column(sqlalchemy.String(14))
Base.metadata.create_all(engine)
メモリ上でSQLiteのテーブルを作ろうとしました。
しかし、以下のエラーが発生
例外が発生しました: ImportError
DLL load failed while importing _sqlite3: 指定されたモジュールが見つかりません。
調べたり、教えて頂いたりググった結果、以下の情報がありました。
現在 X64のdellファイルはダウンロードできません。32bitしかSaliteのファイルが公開されていません。
現在アップデート中のようです。
WindowsのX64のDellが公開された時の為に忘持録として残します。
公開されたらダウンロードします。
仕方ないのでUbuntu 20.4のPCで環境を作りました。
Python3.9
Anaconda3
Sqlite3
Vscode
の環境を構築してから
pip3 install SQLAlchemy
エラーがなく動作しました。