zoukankan      html  css  js  c++  java
  • 在 Ubuntu 18.04 /centos7上安装 Python 3.7

    扩展源安装

    sudo apt update
    sudo apt install software-properties-common
    sudo add-apt-repository ppa:deadsnakes/ppa
    
    # 按回车继续
    sudo apt install python3.7
    python3.7 --version
    #安装pip
    wget https://bootstrap.pypa.io/get-pip.py
    python3.7 get-pip.py
    #安装python3.7-develop 包
    sudo apt install python3.7-dev
    

    源码安装

    sudo apt updatesudo apt install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libreadline-dev libffi-dev wget
    wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tar.xz
    tar -xf Python-3.7.3.tar.xz
    cd Python-3.7.3
    #配置
    ./configure --enable-optimizations
    #编译 使用8个cpu同时编译
    make -j 8
    #安装python3.7
    sudo make altinstall
    #测试
    python3.7 --version
    #安装pip
    wget https://bootstrap.pypa.io/get-pip.py
    python3.7 get-pip.py
    #安装python3.7-develop 包
    sudo apt install python3.7-dev
    

    centos7

    #源码安装
    1. 先安装依赖
    yum groupinstall "Development Tools" -y
    yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel libpcap-devel xz-devel libffi-deve -y
    2.下载源码包
    https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tar.xz
    tar -xvf Python-3.7.4.tar.xz
    cd Python-3.7.4
    #配置
    ./configure --prefix=/usr/local/python3
    #可选开启 优化
    ./configure --enable-optimizations
    #编译 (-j 8 代表开启8核同时编译)
    make -j 8 
    #安装
    make install
    
  • 相关阅读:
    Window 窗口类
    使用 Bolt 实现 GridView 表格控件
    lua的table库
    Windows编程总结之 DLL
    lua 打印 table 拷贝table
    使用 xlue 实现简单 listbox 控件
    使用 xlue 实现 tips
    extern “C”
    COleVariant如何转换为int double string cstring
    原来WIN32 API也有GetOpenFileName函数
  • 原文地址:https://www.cnblogs.com/lovesKey/p/11355630.html
Copyright © 2011-2022 走看看