python 安裝mysqldb

Why can't easy_install find MySQLdb?

第一次安裝:

easy_install MySQLdb

失敗找不到包名,原因是名稱錯誤

正確的是:

pip install  MySQL-python

然後編譯報錯:

 Command "/usr/bin/python2.7 -c "import setuptools, tokenize;__file__='/tmp/pip-build-VQ6tqp/MySQL-python/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-ZRqghi-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-VQ6tqp/MySQL-python

原因是mysql-devel開發包沒有安裝

yum install mysql-devel


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章