首页 > Python > 在CentOS或Ubuntu上通过源码安装python3.7

在CentOS或Ubuntu上通过源码安装python3.7

2018年9月14日
分类: Python 标签:
发表评论 阅读评论

在CentOS或Ubuntu上安装python3.7的步骤是类似的,区别在于依赖库的安装。具体步骤如下:

1,安装依赖库

  • CentOS

    yum -y install zlib zlib-devel
    yum -y install bzip2 bzip2-devel
    yum -y install ncurses ncurses-devel
    yum -y install readline readline-devel
    yum -y install openssl openssl-devel openssl-static
    yum -y install xz lzma xz-devel
    yum -y install sqlite sqlite-devel
    yum -y install gdbm gdbm-devel
    yum -y install tk tk-devel
    yum -y install libffi-devel

  • Ubuntu

    sudo apt-get install zlib1g-dev libbz2-dev libssl-dev libncurses5-dev libsqlite3-dev libreadline-dev tk-dev libgdbm-dev libdb-dev libpcap-dev xz-utils libexpat1-dev liblzma-dev libffi-dev libc6-dev

2,下载python3.7源码,并编译安装

wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz && tar xzvf Python-3.7.0.tgz && cd Python-3.7.0 && ./configure –enable-optimizations && make && make install

3,创建软链接

[ -f /usr/local/bin/python3 ] && ln -sf /usr/local/bin/python3 /usr/bin/python3 && ln -sf /usr/bin/python3 /usr/bin/python

小赢理财-众安保险本息保障

零一积流|IT参考 原创文章,转载请注明出处: http://www.it-refer.com/2018/09/14/install-python3-7-through-source-code-on-centos-or-ubuntu


您可能需要这些【参考资料】:
  1. 本文目前尚无任何评论.
您必须在 登录 后才能发布评论.