-
-
Save yetone/c3bb5d438706d7fc90f3c1e666c87d4c to your computer and use it in GitHub Desktop.
fix 'can not find libmysqlclient.so.18' error of python mysql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def init_db_env(): | |
import sys, os | |
os.environ["PYTHON_EGG_CACHE"] = "/tmp" | |
os.environ['PYTHONPATH']= '/home/rex/local/lib/python2.6/site-packages' | |
os.environ["LD_LIBRARY_PATH"] = '/home/rex/local/lib:/usr/lib/' | |
sys.path.append('/home/rex/local/lib/python2.6/site-packages') | |
sys.path.append('/home/rex/local/lib') | |
sys.path.append('/usr/lib/') | |
from ctypes import cdll | |
cdll.LoadLibrary("/usr/lib/libmysqlclient.so.18") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment