yum -y install gcc
提示 :
Loaded plugins: fastestmirror, refresh-packagekit, security
Existing lock /var/run/yum.pid: another copy is running as pid 7172.
Another app is currently holding the yum lock; waiting for it to exit...
果断删除yum.pid(以root用户):rm /var/run/yum.pid
2,为了安装setuptools,要需要安装zlib:
python setup.py install
10,测试pip,如果报错“pkg_resources.DistributionNotFound: The 'pip==7.1.2' distribution was not found and is required by the application”,此时需要修改pip可执行程序:
[iyunv@iZ251ed9ao2Z ~]# python
Python 2.7.11 (default, Oct 18 2016, 09:34:16)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-17)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import MySQLdb
>>>
如果正常,则ok,否则按照以下步骤安装:
1,到官网下载源代码:MySQL-python-1.2.3.tar.gz
2,编译安装:cd MySQL-python-1.2.3 && python setup.py install
3,若出现错误:_mysql.c:2444: error: ‘_mysql_ConnectionObject’ has no member named ‘open’ ,则安装以下包: