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_ ...
随机推荐
- 第三次作业— C++计算器项目的初始部分
作业题目: C++计算器项目的初始部分 仓库 代码: Scan.h #ifndef SCAN_H #define SCAN_H #include<string> #include<i ...
- 高可用集群(crmsh详解)http://www.it165.net/admin/html/201404/2869.html
crmsh是pacemaker的命令行接口工具,执行help命令,可以查看shell接口所有的一级命令和二级命令,使用cd 可以切换到二级子命令的目录中去,可以执行二级子命令 在集群中的资源有四类:p ...
- 结队第二次作业——WordCount进阶需求
结队第二次作业--WordCount进阶需求 博客地址 051601135 岳冠宇 博客地址 051604103 陈思孝 博客地址 Github地址 具体分工 队友实现了爬虫功能,我实现了wordco ...
- 学习mysql触发器遇到的问题
在 mysql.exe 下面运行的.如果是的话, 可能是需要加一个 定义 DELIMITER // 意思是告诉 mysql , 遇到 // 符号以后, 才认为语句结束了. 否则 mysql 遇到 分号 ...
- 使用IPMI操作Dell服务器
机房里有5台实验用的Dell R710服务器,为了低碳环保,我决定只在工作日白天开启它们,其余时间全部关闭.我选择在linux下用ipmitool结合计划任务来实现,这里只记录ipmitool工具的用 ...
- 【Linux笔记】ps、kill、netstat、nohup、screen
1.ps 命令,用于查看当前正在运行的进程,使用该命令可以确定有哪些进程正在运行和运行的状态.进程是否结束.进程有没有僵尸.哪些进程占用了过多的资源等等. 语法: ps [options] 示例: p ...
- 解决MySQL Slave 触发 oom-killer
最近经常有收到MySQL实例类似内存不足的报警信息,登陆到服务器上一看发现MySQL 吃掉了99%的内存,God ! 有时候没有及时处理,内核就会自己帮我们重启下MySQL,然后我们就可以看到 dme ...
- Shell脚本创建Nginx的upstream及location配置文件
#!/bin/sh ##################################################### # Name: create_nginx_conf.sh # Versi ...
- Spring面试,IoC和AOP的理解, @Transactional原理及使用
spring 的优点?1.降低了组件之间的耦合性 ,实现了软件各层之间的解耦 2.可以使用容易提供的众多服务,如事务管理,消息服务等 3.容器提供单例模式支持 4.容器提供了AOP技术,利用它很容易实 ...
- Pythonの坑
Python closures and late binding A closure occurs when a function has access to a local variable fro ...