zoukankan      html  css  js  c++  java
  • CentOS 7.8 安装 Python 3.8.5

    https://danieleriksson.net/2017/02/08/how-to-install-latest-python-on-centos/

    Use “make altinstall” to prevent problems

    It is critical that you use make altinstall when you install your custom version of Python. If you use the normal make install you will end up with two different versions of Python in the filesystem both named python. This can lead to problems that are very hard to diagnose.

    # Python 3.8.5:
    wget http://python.org/ftp/python/3.8.5/Python-3.8.5.tar.xz
    tar xf Python-3.8.5.tar.xz
    cd Python-3.8.5
    ./configure --prefix=/usr/local --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"
    make && make altinstall
    # pwd
    /usr/local/bin
    # ls py*
    pydoc3  pydoc3.8  python3.8  python3.8-config
    /usr/local/bin/python3.8
    # /usr/local/bin/python3.8
    Python 3.8.5 (default, Sep  4 2020, 19:48:39)
    [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import cytpes
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    ModuleNotFoundError: No module named 'cytpes'
    >>> exit()

    # python3.8
    Python 3.8.5 (default, Sep  4 2020, 19:48:39)
    [GCC 4.8.5 20150623 (Red Hat 4.8.5-39)] on linux
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import cyptes
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    ModuleNotFoundError: No module named 'cyptes'

    wget https://bootstrap.pypa.io/get-pip.py

    python3.8 get-pip.py
     

    # yum install libffi-devel
    已加载插件:fastestmirror, langpacks
    Loading mirror speeds from cached hostfile
     * base: mirror.lzu.edu.cn
     * elrepo: mirrors.tuna.tsinghua.edu.cn
     * epel: my.mirrors.thegigabit.com
     * extras: mirror.lzu.edu.cn
     * updates: mirror.lzu.edu.cn
    软件包 libffi-devel-3.0.13-19.el7.x86_64 已安装并且是最新版本
    无须任何处理

  • 相关阅读:
    Angular2新人常犯的5个错误
    好爱情,坏爱情
    关于css中a标签的样式
    移动端rem布局实践
    我们这一代人的困惑
    原创ui.router源码解析
    Web客户端数据存储学习笔记——Cookie
    喝汤了——如何用一年时间获得十年的能力和经验
    Petya勒索木马
    推荐几个精致的web UI框架
  • 原文地址:https://www.cnblogs.com/emanlee/p/13615952.html
Copyright © 2011-2022 走看看