0
0

More than 1 year has passed since last update.

Windows 10 sqlalchemy ImportError

Posted at

環境
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: 指定されたモジュールが見つかりません。

調べたり、教えて頂いたりググった結果、以下の情報がありました。

How To Fix ImportError: DLL Load Failed While Importing _sqlite3: The Specified Module Could Not Be Found.

現在 X64のdellファイルはダウンロードできません。32bitしかSaliteのファイルが公開されていません。
現在アップデート中のようです。

WindowsのX64のDellが公開された時の為に忘持録として残します。
公開されたらダウンロードします。

仕方ないのでUbuntu 20.4のPCで環境を作りました。
Python3.9
Anaconda3
Sqlite3
Vscode
の環境を構築してから


pip3 install SQLAlchemy

エラーがなく動作しました。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0