CentOS6安装Pyhon3

时间:2024-07-05 09:04:56

一,从官方下载Python3.6

[root@linux-node1 src]# pwd
/usr/local/src
[root@linux-node1 src]# wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz

二,解压并安装

[root@linux-node1 src]#tar xvzf Python-3.6..tgz
[root@linux-node1 src]#cd Python-3.6./
[root@linux-node1 Python-3.6.]#./configure --prefix=/user/local/python3.
[root@linux-node1 Python-3.6.]#make && make install

三,建立Python3.6软连接,方便执行程序

ln -s  /usr/local/python3./bin/python3 /usr/bin/python3

四,检查安装师傅成功

[root@linux-node1 ~]# python3
Python 3.6. (default, Dec , ::)
[GCC 4.4. (Red Hat 4.4.-)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>

五,安装pip9.0并建立软连接

wget https://pypi.python.org/packages/11/b6/abcb525026a4be042b486df43905d6893fb04f05aac21c32c638e939e447/pip-9.0.1.tar.gz#md5=35f01da33009719497f01a4ba69d63c9
tar zxf pip-9.0..tar.gz
cd pip-9.0.
python3 setup.py install
ln -s /usr/local/python3./bin/pip3 /usr/bin/pip

六,通过pip安装python模块

pip install pyzabbix