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

编译、安装:

    [[email protected] /]# tar -xzvf /usr/local/src/Python-3.6.4.tgz -C /usr/local/src/
    [[email protected] /]# cd /usr/local/src/Python-3.6.4
    [[email protected] Python-3.6.4]# ./configure --prefix=/usr/local/python
    [[email protected] Python-3.6.4]# make -j 4
    [[email protected] Python-3.6.4]# make install

查看扩展安装包:

    [[email protected] /]# /usr/local/python/bin/pip3 list
    pip (8.1.1) setuptools (20.10.1)

添加Python命令到环境变量:

[[email protected] /]# vim ~/.bash_profile

    PATH=$PATH:$HOME/bin
    改为:
    PATH=$PATH:$HOME/bin:/usr/local/python/bin

使环境变量生效:

[[email protected] /]# source ~/.bash_profile

查看Python版本:

    [[email protected] /]# python3 -V
    Python 3.6.4

更改系统默认python版本为Python3.6

[[email protected] /]# mv /usr/bin/python /usr/bin/python2.6
    [[email protected] /]# ln -s /usr/local/python/bin/python3.6 /usr/bin/python

核对Python版本:

[[email protected] /]# python -V
    Python 3.6.4

解决python升级后,YUM不能正常工作的问题:

#vi /usr/bin/yum

   将文件头部的   #!/usr/bin/python

  改成   #!/usr/bin/python2.6

原文地址:https://www.cnblogs.com/music378/p/8267370.html

时间: 2024-10-08 07:25:20

centos6安装python3.6.4的相关文章

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

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 htt

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