linux下安装python3

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了linux下安装python3相关的知识,希望对你有一定的参考价值。

1、安装zlib、OpenSSL
yum install –y gcc gcc-c++ openssl openssl-devel zlib zlib-devel

2、下载安装python3
cd /home/admin/software/python
wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tgz
tar –zxvf Python3.6.5.tgz
cd Python3.6.5
./configure –prefix=/home/admin/project/python
技术分享图片
make &make install
技术分享图片
ln -s /home/admin/project/python/bin/python3 /usr/bin/python3
python3 –version
技术分享图片
python3
技术分享图片

3、安装pip、setuptools,系统自带pip-9.0.3和setuptools-39.0.1
cd /home/admin/software/python
wget --no-check-certificate https://files.pythonhosted.org/packages/ae/e8/2340d46ecadb1692a1e455f13f75e596d4eab3d11a57446f08259dee8f02/pip-10.0.1.tar.gz
tar –zxvf pip-10.0.1.tar.gz
cd pip-10.0.1
python3 setup.py build
python3 setup.py install

wget --no-check-certificate https://files.pythonhosted.org/packages/1a/04/d6f1159feaccdfc508517dba1929eb93a2854de729fa68da9d5c6b48fa00/setuptools-39.2.0.zip
unzip setuptools-39.2.0.zip
cd setuptools-39.2.0
python3 setup.py build
python3 setup.py install

以上是关于linux下安装python3的主要内容,如果未能解决你的问题,请参考以下文章

Linux下安装Python3

linux下安装python3

Linux环境下安装python3

Linux 下python3.7 安装

linux下安装python3

python3 linux下安装