首页 > 系统相关 >CentOS7 安装 python 3.7.4

CentOS7 安装 python 3.7.4

时间:2022-09-06 17:14:09浏览次数:83  
标签:Python python CentOS7 3.7 报错 install 安装

 

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

相关文章

  • python struct unpack
    pythonstructunpackmsg=self.serverSocket.recv(1024)#接受服务端消息AngleSensorST,y_Angle_deg,x_Angle_deg,Z_Angle_deg,AngleDeviceTEMP,WatchdogCount=st......
  • 为了防止这个公众号被封,我连夜用Python爬取了它所有图片~
    哈喽兄弟们,今天来试试批量获取公众号文章,emmm…  虽然名义上是文章,单其实它是一篇纯图片文,至于为什么不是文字,小姐姐不比文字香?  事前准备 ......
  • python requests.post() 请求中 json 和 data 的区别
    requests.post()请求中json和data的区别post请求中,可以使用data传递参数,也可以使用json传递参数。那么,两种方式有什么区别?1.如果参数为JSON数据,可以直接传入json参......
  • Linux centos7 安装nginx
    安装前准备安装GCC编译环境yuminstall-ygccgcc-c++autoconfautomakemake安装模块依赖Nginx支持的功能模块需要有第三方的库支持,例如gzip的zlib库,rewrite重写需......
  • python基础语法
    Python标识符在Python里,标识符由字母、数字、下划线组成。在Python中,所有标识符可以包括英文、数字以及下划线(_),但不能以数字开头。Python中的标识符是区分大小写......
  • python项目结束后权限管理配置
    一、创建rbac的apppythonmanage.pystartapprbac注入;settings.py的INSTALLED_APPS中二、创建rbac表,在rbac的models.py中添加fromdjango.dbimportmodels#权限......
  • Python 中的 sorted 和 sort的区别
    Python中的sorted和sort的区别#sort与sorted区别:#sorted()是内置函数.sorted可以对所有可迭代的对象进行排序操作,有返回值,返回列表;#sort是list上的方法,是对......
  • 【python】sort 排序
    sort排序fromoperatorimportitemgettera=[ {'name':'小张','create_time':'2020-10-1609:56'}, {'name':'小王','create_time':'2020-10-1609:57'}, {'name'......
  • 晓晓---python文件的读写模式的理解
    1.python读取文件模式的自我理解:'r'openforreading(default)----只读模式打开文件,不能写;'w'openforwriting,truncatingthefilefirst----只写模式......
  • Python-注解-类型注解
    类型注解的作用Python是动态语言,其显著特点是在声明变量时,你不需要显式声明它的类型。程序运行时会推断出变量age是int类型但是:如果你代码某些变量的类型有错,编辑器......