完整安装RabbitMQ之一:Python的安装
安装Python才能安装RabbitMQ
操作方法
- 01
1,先安装GCC,用如下命令yum install gcc gcc-c++ 2,下载python-2.7.5.tar.gz文件,修改文件权限chmode +x python-7.5.tar.gz 3,解压tar文件,tar -xzvf python-2.7.5.tar.gz 4,cd python-2.7.5 ./configure --prefix=/usr/local/python27 ### 注意:安装在新目录,防止覆盖系统 默认安装的python make && make install 5、建立软连接,使系统默认的python指向python27 mv /usr/bin/python /usr/bin/python2.6.6.old ln -s /usr/local/python27/bin/python /usr/bin/python
- 02
已经安装完成python的安装或升级的全部操作了,我们再来看一下现在的python的版本: 引用 # python -V Python 2.7.5
- 03
虽然现在python已经安装完成,但是使用yum命令会有问题——yum不能正常工作: 引用 # yum list There was a problem importing one of the Python modules required to run yum. The error leading to this problem was: No module named yum Please install a package which provides this module, or verify that the module is installed correctly. It's possible that the above module doesn't match the current version of Python
- 04
这是因为yum默认使用的python版本是2.6.6,到哪是现在的python版本是2.7.5,故会出现上述问题,只需要该一下yum的默认python配置版本就行了: 引用 #vi /usr/bin/yum 将文件头部的#!/usr/bin/python改为 #!/usr/bin/python2.6