python3 下没办法运行sqlalchemy ?

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python3 下没办法运行sqlalchemy ?相关的知识,希望对你有一定的参考价值。

[[email protected] python]# python3 router.py 

Traceback (most recent call last):

  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/dialects/sqlite/pysqlite.py", line 337, in dbapi

    from sqlite3 import dbapi2 as sqlite  # try 2.5+ stdlib name.

  File "/usr/local/lib/python3.6/sqlite3/__init__.py", line 23, in <module>

    from sqlite3.dbapi2 import *

  File "/usr/local/lib/python3.6/sqlite3/dbapi2.py", line 27, in <module>

    from _sqlite3 import *

ModuleNotFoundError: No module named ‘_sqlite3‘


During handling of the above exception, another exception occurred:


Traceback (most recent call last):

  File "router.py", line 2, in <module>

    from db import *

  File "/home/ming/python/db.py", line 11, in <module>

    db_engine = create_engine(‘sqlite:///:memory:‘, echo = False) 

  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/__init__.py", line 391, in create_engine

    return strategy.create(*args, **kwargs)

  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/strategies.py", line 80, in create

    dbapi = dialect_cls.dbapi(**dbapi_args)

  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/dialects/sqlite/pysqlite.py", line 339, in dbapi

    raise e

  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/dialects/sqlite/pysqlite.py", line 334, in dbapi

    from pysqlite2 import dbapi2 as sqlite

ModuleNotFoundError: No module named ‘pysqlite2‘

[[email protected] python]# 


以上是关于python3 下没办法运行sqlalchemy ?的主要内容,如果未能解决你的问题,请参考以下文章

Eclipse下无法自动编译,或者WEB-INF/classes目录下没文件,编译失败的解决办法(转载)

Python3之sqlalchemy

Python3-ORM-Sqlalchemy

Python3+SQLAlchemy+Sqlite3实现ORM教程

python3.7 sqlalchemy没有名为'MySQLdb'的模块[重复]

Python3-sqlalchemy-orm 回滚