赞
踩
Traceback (most recent call last):
File "send.py", line 5, in <module>
from db import *
File "/Users/ko/projects/php/edm/db.py", line 7, in <module>
import MySQLdb
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/MySQLdb/__init__.py", line 19, 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
昨天之行了一次 brew upgrade
导致 mysql、php 全部都错误。进入 /usr/local/opt/mysql/lib/
,查看文件存在:
~$ ls -la /usr/local/opt/mysql/lib/
total 22448
drwxr-xr-x 8 ko staff 272 6 29 00:42 .
drwxr-xr-x 15 ko staff 510 9 1 22:02 ..
-rw-r--r-- 1 ko staff 5424044 9 1 22:01 libmysqlclient.21.dylib
-r--r--r-- 1 ko staff 6047688 6 29 00:42 libmysqlclient.a
lrwxr-xr-x 1 ko staff 23 6 29 00:42 libmysqlclient.dylib -> libmysqlclient.21.dylib
-r--r--r-- 1 ko staff 9624 6 29 00:42 libmysqlservices.a
drwxr-xr-x 3 ko staff 102 9 1 22:01 pkgconfig
drwxr-xr-x 91 ko staff 3094 6 29 00:42 plugin
链接一个20版本到21
ln -s libmysqlclient.21.dylib libmysqlclient.20.dylib
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。