zoukankan      html  css  js  c++  java
  • CentOS7下python3.x的源码安装

    一、安装过程

    1、下载源码包

     下载地址:https://www.python.org/downloads/source/

     或:https://www.python.org/ftp/python/

    2、解压安装包,以python 3.7.8为例

    [root@localhost ~]# ll Python-3.7.8.tgz 
    -rw-r--r-- 1 root root 23276116 Jul  3 16:40 Python-3.7.8.tgz
    [root@localhost ~]# tar -zxvf Python-3.7.8.tgz

    3、安装相关依赖包

    [root@localhost ~]# 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 libffi-devel

    4、开始编译安装

    [root@localhost ~]# cd Python-3.7.8/
    [root@localhost Python-3.7.8]# ./configure --prefix=/usr/local/python3
    [root@localhost Python-3.7.8]# make && make install

    5、建立软链接

    [root@localhost Python-3.7.8]# ln -s /usr/local/python3/bin/python3.7 /usr/bin/python3
    [root@localhost Python-3.7.8]# ln -s /usr/local/python3/bin/pip3.7 /usr/bin/pip3

    6、测试

    [root@localhost Python-3.7.8]# python3
    Python 3.7.8 (default, Jul  3 2020, 16:47:10) 
    [GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> exit()
    [root@localhost Python-3.7.8]# pip3 --version
    pip 20.1.1 from /usr/local/python3/lib/python3.7/site-packages/pip (python 3.7)
  • 相关阅读:
    python 保存两位小数
    python 临时文件
    Windows 10 右键 在此处打开 CMD
    windows 10 右键菜单注册表位置
    GoLand 设置与配置
    docker 相关指令
    ubuntu下python版本间切换
    gitLab本地推送到远程仓库的命令
    CSS的性能优化
    Web前端:11个让你代码整洁的原则
  • 原文地址:https://www.cnblogs.com/hovin/p/13231333.html
Copyright © 2011-2022 走看看