Centos6 安装python3.6

1.安装依赖包
yum install bzip2-devel db4-devel expat-devel gcc gdbm-devel libffi-devel libpcap-devel ncurses-devel openssl-devel patch python-devel readline-devel sqlite-devel tk-devel xz-devel zlib-devel -y

2.下载python3.6安装包:
wget --no-check-certificate https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz

3.解压到当前目录:
tar -zxvf Python-3.6.0.tgz

4.打开文件夹
cd Python-3.6.0

5.配置并编译安装
./configure --prefix=安装python的路径 --enable-shared
make & make install

6.重新建立连接
mv /usr/local/bin/python /usr/local/bin/python_bak
ln -s /usr/local/python3.6/bin/python3 /usr/bin/python3

7.完成后,会发现yum用不了,因为yum是使用的python2.6的版本,所以还需要修改一下,修改第一行
# vim /usr/bin/yum
把!/usr/bin/python修改为!/usr/bin/python2.6
重新运行yum就可以使用了

8.此时运行python3命令的话会报错,缺少.so文件,我们需要进行如下操作:
cp -R /usr/local/python3/lib/* /usr/lib64/

9.安装所需要的包

10.测试python是否安装完成,在命令行键入
# python

原文地址:https://www.cnblogs.com/amy720/p/12185943.html

时间: 2024-10-03 14:45:52

Centos6 安装python3.6的相关文章

centos6安装python3.4和pip3

在安装了epel源的情况下,直接yum就可以安装python3.4 yum install python34 -ypython3 --version 没有自带pip3,从官网安装 wget --no-check-certificate https://bootstrap.pypa.io/get-pip.py python3 get-pip.pypip3 -V 写个简单的代码 #!/usr/bin/python3 # -*- coding: UTF-8 -*- import sys print(s

centos6 安装python3.5后pip无法使用的处理

现象:安装pip后发现命令无法识别command not found 原因:which查看找到不到执行路径   find搜索发现安装后存放在/usr/local/python3.5/bin下,于是判断是因为没有注册路径的问题 解决:参考地址为https://lempstacker.com/tw/Installing-Python-3-5-on-CentOS-7/ http://blog.csdn.net/apn172/article/details/8868968 1.导出头文件: /usr/l

centos6安装python3.6.4

安装Python依赖包: [[email protected] src]# yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make 下载Python源码包: [[email protected] src]# wget ttp://mirrors.sohu.com/python/3.6.4/Python-3.6.4.tgz 编译.安装:

centos6安装python3

到官网找到最新版本源码下载地址 https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tgz [[email protected] Downloads]# wget https://www.python.org/ftp/python/3.5.1/Python-3.5.1.tgz [[email protected] Downloads]# tar zxvf Python-3.5.1.tgz cd Python-3.5.1 ./configure

centos6.5下安装python3安装、python3虚拟环境创建venv

原因:在安装完centos6.5后,通过命令行键入python时,默认为python2.6.6版本,系统并没有安装python3版本.又想学习python3,因此需要在centos6.5下安装python3版本. <python3安装> 1.下载python3的安装包: (1)如果能够联网,则直接: [[email protected] 3pyex]# wget https://www.python.org/ftp/python/3.6.0/Python-3.6.0.tgz 其中,我这里安装的

centos6.8安装python3.7.3报错Can&#39;t connect to HTTPS URL because the SSL module is not available问题解决

环境:CentOS release 6.8 (Final) # 直接编译python3.7在使用pip3安装依赖的时候报错: Can't connect to HTTPS URL because the SSL module is not available. 解决方法: 1.编译安装OpenSSL 1.0.2j版本并重新配置环境变量 下载OpenSSL源码包: wget http://www.openssl.org/source/openssl-1.0.2j.tar.gz 解压缩,编译安装:

centos6/7 python3及yum安装教程

适用于Centos6/7 1.配置好epel源和ius源 Centos 6 yum install https://centos6.iuscommunity.org/ius-release.rpm -ywget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo Centos 7 yum install https://centos7.iuscommunity.org/ius-release.rpm -

centos6.5安装python3.5 和 ipython

云盘包地址 :http://pan.baidu.com/s/1bpsgXUf环境 centos 6.5 最小化安装版,装好开发环境包. ①安装python3.5 yum install readline-devel -y  #不安装会导致python解释器里面没法用删除键等tar -zxvf Python-3.5.1.tgzcd Python-3.5.1./configure –prefix=/usr/local –enable-sharedmake && make installln -

CentOS6.8安装Python3.6.3

1.linux下安装python3 准备编译环境(环境如果不对的话,可能遇到各种问题,比如wget无法下载https链接的文件) yum install zlib-devel bzip2-devel openssl-devel ncurses-devel -y 2.下载 Python3.6代码包 wget https://www.python.org/ftp/python/3.6.3/Python-3.6.3.tar.xz 在安装包中有一个README的文件,里面有写如何安装,解压并安装 tar