reason : image not found 老师请教一下这是什么问题

来源:3-1 环境配置及依赖安装

Simon_Ch

2018-08-02

错误代码

>>> import MySQLdb

Traceback (most recent call last):

  File "<stdin>", line 1, in <module>

  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/MySQLdb/__init__.py", line 18, in <module>

    import _mysql

ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/_mysql.cpython-36m-darwin.so, 2): Library not loaded: /usr/local/opt/mysql/lib/libmysqlclient.20.dylib

  Referenced from: /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/_mysql.cpython-36m-darwin.so

  Reason: image not found


写回答

1回答

NavCat

2018-08-02

你这个是mysql 中的python依赖没安装好。

pip install mysqlclient  

重新安装下

0
0

Python操作三大主流数据库-MySQL+MongoDB+Redis

一次实战同时掌握Python操作MySQL,MongoDB,Redis 三大数据库使用技巧

2024 学习 · 376 问题

查看课程