centos7中安装python3.7.3

服务器版本

  • 环境: CentOS_7 (root用户)
  • 软件版本: python_3.7.3

安装依赖

  • yum -y groupinstall "Development tools"
  • 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

下载软件源码 Python-3.7.3

解压并编译源码

  • tar zxvf Python-3.7.3.tgz
  • cd Python-3.7.3/
  • ./configure --prefix=/usr/local/python-3.7.3
  • make && make install

配置软链接

  • ln -s /usr/local/python-3.7.3/bin/python3.7 /usr/bin/python3
  • ln -s /usr/local/python-3.7.3/bin/pip3.7 /usr/bin/pip3

验证

python3 -V

pip3 -V

小道消息

python-3.7.3有一个关于asyncio的底层逻辑bug,此bug在3.7.4及以后版本已经修复(本人asyncio使用的少未发现qaq)

posted @ 2021-01-10 10:44  coderdogz  阅读(129)  评论(0编辑  收藏  举报
Live2D