我的是python3.6 提示如下
来源:4-5 通过ORM新增数据到数据库
balabalahong
2018-09-01
engine = create_engine("mysql://root:990615z@127.0.0.1/news")
File "/Users/zj/anaconda/envs/Pein/lib/python3.6/site-packages/sqlalchemy/engine/__init__.py", line 387, in create_engine
return strategy.create(*args, **kwargs)
File "/Users/zj/anaconda/envs/Pein/lib/python3.6/site-packages/sqlalchemy/engine/strategies.py", line 80, in create
dbapi = dialect_cls.dbapi(**dbapi_args)
File "/Users/zj/anaconda/envs/Pein/lib/python3.6/site-packages/sqlalchemy/dialects/mysql/mysqldb.py", line 110, in dbapi
return __import__('MySQLdb')
ModuleNotFoundError: No module named 'MySQLdb'
1回答
-
NavCat
2018-09-02
你的mysql的Python依赖没安装好。
pip install mysqlclient00
Python操作三大主流数据库-MySQL+MongoDB+Redis
2024 学习 · 376 问题
相似问题