• Django项目:CMDB(服务器硬件资产自动采集系统)--09--06CMDB测试Linux系统采集硬件数据的命令04


    root

    123456

    ip addr

     

    init 0

    root

    123456

    ip addr

    root

    123456

    python3

    yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel

    yum -y install wget

    在Linux上安装Python3
    
    1. 安装依赖环境
    # yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel
    2.下载Python3
    # wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tgz
    3.安装python3
    
      我个人习惯安装在/usr/local/python3(具体安装位置看个人喜好)
      创建目录:
    # mkdir -p /usr/local/python3
      解压下载好的Python-3.x.x.tgz包(具体包名因你下载的Python具体版本不不同⽽而不不同,如:我下载的是Python3.6.1.那我这里就是Python-3.6.1.tgz)
    
    # tar -zxvf Python-3.6.1.tgz
    
    
    4.进入解压后的目录,编译安装。
    (编译安装前需要安装编译器yum install gcc)
    # cd Python-3.6.1
    # ./configure --prefix=/usr/local/python3  
    
                 (#/usr/local/python3为安装目录)
    
    # make
    #make install    
    
    (或者 make && make install)
    
    5.建立python3的软链
    # ln -s /usr/local/python3/bin/python3 /usr/bin/python3
    
    6.并将/usr/local/python3/bin加入PATH
    
    # vim ~/.bash_profile
    # .bash_profile
    # Get the aliases and functions
    if [ -f ~/.bashrc ]; then
    . ~/.bashrc
    fi
    # User specific environment and startup programs
    PATH=$PATH:$HOME/bin:/usr/local/python3/bin
    export PATH
      按ESC,输入:wq回车退出。
    
      修改完记得执行行下面的命令,让上一步的修改生效:
    
    # source ~/.bash_profile
      检查Python3及pip3是否正常可用:
    
    # python3 -V
    Python 3.6.1
    # pip3 -V
    pip 9.0.1 from /usr/local/python3/lib/python3.6/site-packages (python 3.6)
    
    7.不行的话尝试创建一下pip3的软链接
    # ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
  • 相关阅读:
    GCPC2014 A Algebraic Teamwork
    ACM-ICPC North America Qualifier 2014 Eight Queens
    ACM-ICPC North America Qualifier 2014 Units
    ACM-ICPC North America Qualifier 2014 Narrow Art Gallery
    ACM-ICPC North America Qualifier 2014 Human Cannonball Run
    ACM-ICPC North America Qualifier 2014 Tractor
    Codeforces 459E Pashmak and Graph
    Codeforces 455C Civilization
    Codeforces 478D Red-Green Towers
    Codeforces 274B Zero Tree
  • 原文地址:https://www.cnblogs.com/ujq3/p/9245371.html
Copyright © 2020-2023  润新知