Python MySQLdb错误Mac OS

时间:2018-07-26 15:40:56

标签: python mysql-python

这些是我的头文件:

import face_recognition.api as face_recognition
from multiprocessing 
import Pool
from multiprocessing 
import cpu_count
import scipy.misc
import warnings
import re
import click
import MySQLdb
import os
import datetime
import logging
import sys
import subprocess

global curr_date
global course_id

运行python脚本时,出现此错误:

Traceback (most recent call last):
  File "/Applications/XAMPP/xamppfiles/htdocs/akriti/veri_test1.py", line 21, in <module>
    import MySQLdb
  File "/Users/akriti/Library/Python/2.7/lib/python/site-packages/MySQLdb/__init__.py", line 18, in <module>
    import _mysql
ImportError: dlopen(/Users/akriti/Library/Python/2.7/lib/python/site-packages/_mysql.so, 2): Library not loaded: @rpath/libmysqlclient.21.dylib
  Referenced from: /Users/akriti/Library/Python/2.7/lib/python/site-packages/_mysql.so
  Reason: image not found

我已经尝试了很多互联网上提供的功能,但是似乎没有任何效果。我使用Mac OS High Sierra。

0 个答案:

没有答案