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_ ...
随机推荐
- Leetcode题库——17.电话号码的字母组合
@author: ZZQ @software: PyCharm @file: letterCombinations.py @time: 2018/10/18 18:33 要求:给定一个仅包含数字 2- ...
- 复杂PC问题——信号量与共享存储区
#include <stdio.h> #include <unistd.h> #include <sys/ipc.h> #include <sys/sem.h ...
- 利用session创建的cookies是这样的
版权声明:本文为博主原创文章,未经博主允许不得转载.
- 【CS231N】7、卷积神经网络
一.疑问 1. assignments2 在代码文件FullyConnectedNets.ipynd 中,有代码如下: # Test the affine_forward function num_i ...
- 《构建之法》第四&十七章读书笔记
<构建之法>第四&十七章读书笔记 一. 前言 再次阅读<构建之法>,愈发被其中生动有趣的举例吸引.作为一本给予软件工程学生的书籍,其不以枯燥的理论知识 ...
- 项目报错“JavaServer Faces 2.2 can not be installed : One or more constraints”等一系列问题
在做springmvc+maven项目时,经常遇到如下错误: 解决办法(这里以jdk1.8,web3.0为例): 一:保证build path的jre版本 remove掉旧版本的,add新版本 二:保 ...
- Java中DAO的实现
J2EE 开发人员使用数据访问对象(Data Access Object DAO)设计模式,以便将低级别的数据访问逻辑与高级别的业务逻辑分离.实现 DAO 模式涉及比编写数据访问代码更多的内容.在本文 ...
- Beta阶段——3
一.提供当天站立式会议照片一张: 二. 每个人的工作 (有work item 的ID) (1) 昨天已完成的工作: 今天主要是对管理员功能进行改进,解决了Alpha阶段出现的一些问题 (2) 今天计划 ...
- SEO优化之HTML代码优化最重要的5个标签
众所周知,HTML代码一直是搜索引擎抓取的重点.搜索引擎会将HTML中的某些元素标签作为影响网页排名的重要依据 在我们之前的文章中也或多或少地向大家介绍了有关HTML代码的优化技巧,接下来将系统地讲解 ...
- 【移动端debug-4】iOS下setTimeout无法触发focus事件的解决方案
开篇总结:其实目前无法解决这个bug. 这两天做项目遇到了这个case,项目需求是打开页面的时候,input元素自动弹起键盘.由于各种方面的考虑,我们希望通过setTimeout延时200毫秒让inp ...