• centos7安装Python3


    下载python源码包

    网址:https://www.python.org/downloads/release/python-362/

    下载地址:https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tgz

    安装库环境

    [root@localhost opt]# yum install gcc patch libffi-devel python-devel zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel -y

    下载并解压安装包

    [root@localhost opt]# wget https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tgz
    [root@localhost opt]# tar -xf Python-3.6.2.tgz

    进入到解压后的目录中

    [root@localhost opt]# cd python36/
    [root@localhost python36]# ./configure --prefix=/opt/python36
    [root@localhost python36]# make && make install

    添加环境变量

    查看环境变量

    [root@localhost opt]# echo $PATH
    /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/root/bin

    添加python3的工作目录

    [root@localhost python36]#PATH="/opt/python36/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin"

    添加path变量到全局配置文件中,每次开机就加载,在/etc/profile最后一行添加

    PATH="/opt/python36/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin"

    然后

    source /etc/profile
  • 相关阅读:
    响应式网页设计初探
    karma 启动提示PhantomJS not found on PATH
    Vuex 拾遗
    cStringIO 实现指定大小的字符串缓存
    javascript 计算文件MD5 浏览器 javascript读取文件内容
    springmvc值传递
    SpringMVC
    spring事务
    spring整合JDBC
    spring-test与junit
  • 原文地址:https://www.cnblogs.com/wanglan/p/10481136.html
Copyright © 2020-2023  润新知