centos7 install python3.7 with problem and how to fix it.
问题如下:
configure: error: no acceptable C compiler found in $PATH
缺少gcc
zipimport.ZipImportError: can’t decompress data
缺少zlib,zlib-devel No module named '_ctypes'
3.7版本需要一个新的包libffi-devel yum install libffi-devel -y
解决如下:
yum install gcc zlib zlib-devel -y
yum install libffi-devel -y
有关openssl的修复,python找不到ssl模块
安装模块
yum install openssl-devel -y
去掉注视
# Socket module helper for socket()
_socket socketmodule.c # Socket module helper for SSL support; you must comment out the other
# socket line above, and possibly edit the SSL variable:
SSL=/usr/local/ssl
_ssl _ssl.c \
-DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
-L$(SSL)/lib -lssl -lcrypto
有关zlib的修复
到python安装目录下,运行./configure 编辑Modules/Setup文件 vim Modules/Setup 找到下面这句,去掉注释 #zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz
重新编译python3.
./configure --prefix=/usr/local/python3.
make && make install
建立软连接:
ln -s /usr/local/python3./bin/python3 /usr/bin/python3
ln -s /usr/local/python3./bin/pip3 /usr/bin/pip3
效果:

顺便安装了Ipython:
pip3 install ipython #这里必须解决上面ssl模块的问题
ln -s /usr/local/python3.7/bin/ipython /usr/bin/ipython
因为缺少sqlite数据库模块,还有个报错:
/usr/local/python3./lib/python3./site-packages/IPython/core/history.py:: UserWarning: IPython History requires SQLite, your history will not be saved
warn("IPython History requires SQLite, your history will not be saved")
解决方法:
yum install sqlite-devel -y
重新编译python3.7
这些坑相当头疼,所以提早把环境给装好
Ipython效果:

centos7 install python3.7 with problem and how to fix it.的更多相关文章
- centos7 install python3
1. 过程 # 1. root权限, 安装依赖 yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-dev ...
- Centos7 安装python3
Centos7 安装python3 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 #安装sqlite-devel yum -y ...
- centos7安装 python3.6,且保留2.7版本
CENTOS7安装PYTHON3.6 1. 安装python3.6可能使用的依赖# yum install openssl-devel bzip2-devel expat-devel gdbm-dev ...
- CentOS7 安装Python3,开发SocketIO 客户端
CentOS7安装Python3,开发SocketIO 客户端 参考:https://blog.csdn.net/lovefengruoqing/article/details/79284573 步骤 ...
- CentOS7上Python3.5安装
CentOS7上Python3.5安装 1.下载 https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz 2.上传到服务器 3. yum in ...
- CentOS7+ anaconda3 + Python-3.6 + tensorflow-cpu-1.5安装和配置
CentOS7+ anaconda3 + Python-3.6 + tensorflow-cpu-1.5安装和配置 ========================================== ...
- centos7下python3与python2共存并且开启py3虚拟环境
因为下载视频需要用到python3环境,今天在我的win上安装下载工具死活安装不上去,在大盘鸡上一下就安装成功了...可能在win上不兼容吧...无奈只能在大盘鸡上进行折腾了,顺便几个笔记 由于大盘鸡 ...
- Linux(4)- centos7安装python3、Linux下安装、配置virtualenv、确保开发环境的一致性、虚拟环境之virtualenvwrapper、vim
一.centos7安装python3 1.下载python3的源码包 下载地址:https://www.python.org/ftp/python/3.6.2/Python-3.6.2.tgz cd ...
- centos7安装python3.7
Centos7安装Python3的方法 由于centos7原本就安装了Python2,而且这个Python2不能被删除,因为有很多系统命令,比如yum都要用到. [root@VM_105_217_ ...
随机推荐
- beta冲刺(6/7)
目录 组员情况 组员2:胡青元 组员3:庄卉 组员4:家灿 组员5:恺琳 组员6:翟丹丹 组员7:何家伟 组员8:政演 组员9:黄鸿杰 组员10:刘一好 组员11:何宇恒 展示组内最新成果 团队签入记 ...
- 寒假学习计划&进度
学习计划 c语言查缺:这方面的查缺,我觉得我不需要花较多时间,因为老师上课讲的也足够详细,自己学的也自认为没有太多疏漏,所以我假期学习的中心放在了c++上面. c++学习:开始我先看了几集师爷的视频, ...
- HDU 4126 Genghis Khan the Conqueror 最小生成树+树形dp
题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=4126 Genghis Khan the Conqueror Time Limit: 10000/50 ...
- IO流的各种继承关系
- angularJS1笔记-(18)-$http及用angular实现JSONP跨域访问过程
官网上的解释为: The $http service is a core AngularJS service that facilitates communication with the remot ...
- React鼠标事件
说明:假设有一个用户名片,当鼠标滑到上面,显示用户详细信息,且用户详情卡片位置随鼠标位置改变而改变. UI框架:Material-ui 实现思路: 1.一个用户简介组件A(用于展示用户列表): 2.一 ...
- Internet History, Technology and Security (Week 8)
Week 8 Security: Encrypting and Signing This week we start two weeks of Internet Security. It is a l ...
- Python批量文件重命名
今天,得到一个里面都是图片的文件夹,但是图片都没有后缀,因此想用Pythton批量地为所有的文件加上".jpg"的后缀,代码如下: #-*- coding:utf-8 -*- #重 ...
- 更新ffmpeg
今天对公司线上的几台机器做了下ffmpeg的更新,没有什么技术含量,还是简单记录下,做个流水账~哈哈 软件包获取方式 官方网站:https://ffmpeg.org/download.htmlgith ...
- 关于字符编码:ascii、unicode与utf-8
转自:https://foofish.net/unicode_utf-8.html 阮一峰老师对普及计算机基础技术功不可没,但毕竟老师不是神,因此也避免不了对某些概念有一些错误的理解,<字符编码 ...