error: Setup script exited with error: command 'gcc' failed with exit status 1

时光毁灭记忆、已成空白 提交于 2019-11-28 23:14:09

you need to install MySQL Development package

yum install mysql-devel

Install python-devel. That should help

Solved this issue in the following way

  1. Copy MySQLdb folder from site-packages directory of Python2.7 to Python2.6.
  2. Also copy the following files from site-packages directory of Python2.7 to Python2.6.

    _mysql.so

    _mysql_exceptions.py

    _mysql_exceptions.pyc

    _mysql_exceptions.pyo

Now try the following

>>> import MySQLdb  
>>> MySQLdb.__version__  
'1.2.3'
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!