CentOS7 安装 python 3.7.4
# 安装环境(最小化安装) CentOS Linux release 7.0.1406 (Core) # 下载安装包 https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tar.xz # 安装依赖包 yum install gcc zlib* libffi-devel # 解压 tar -xvf Python-3.7.4.tar.xz # 编译、安装 cd Python-3.7.4 ./configure make make install # 安装成功验证 执行 python3 -V Python 3.7.4 ⚠️注意:编译安装注意是否有报错! 缺失gcc库编译报错:configure: error: no acceptable C compiler found in $PATH 解决办法: yum install gcc 缺失zlib库安装报错:zipimport.ZipImportError: can't decompress data; zlib not available 解决办法: yum install zlib* (安装完成后需要重新编译) 缺少libffi-devel安装报错: ModuleNotFoundError: No module named '_ctypes' 解决办法: yum install libffi-devel
更换pip安装源
# 更换安装源 pip3 config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple Writing to /root/.config/pip/pip.conf标签:Python,python,CentOS7,3.7,报错,install,安装 From: https://www.cnblogs.com/yuejunasia/p/16662491.html