美文网首页
CentOS 7 安装 Py3

CentOS 7 安装 Py3

作者: 凉风有信llm | 来源:发表于2019-12-25 14:44 被阅读0次
    1. 下载依赖包
    yum install -y python-devel \
    mysql-devel \
    libxml2 \
    libxml2-devel \
    libxslt* \
    zlib \
    zlib-devel \
    gcc \
    gcc-c++ \
    openssl \
    openssl-devel \
    openldap \
    openldap-devel
    
    1. python 下载
    wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tgz
    
    1. 解压包
    tar xf Python-3.6.5.tgz
    
    1. 创建目录
    mkdir /usr/local/python3
    
    1. 编译安装
    cd Python-3.65
    ./configure --prefix=/usr/local/python3
    make && make install
    
    1. 软链接
    ln -s /usr/local/python3/bin/python3 /usr/bin/python3
    ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
    
    1. 安装py3所需要的包
    pip3 install requests lxml pymysql redis beautifulsoup4
    
    1. 命令行输入python3 看看是否安装成功
    [root@rzxc_test ~]# python3
    Python 3.6.5 (default, Oct 17 2018, 09:53:56)
    [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>>
    
    

    相关文章

      网友评论

          本文标题:CentOS 7 安装 Py3

          本文链接:https://www.haomeiwen.com/subject/bfycoctx.html