[Dynamic Language] Python3.7 源码安装 ModuleNotFoundError: No module named '_ctypes' 解决记录
Python3.7 源码安装 ModuleNotFoundError: No module named '_ctypes' 解决记录
源码安装时报错
File "/home/abeenserver/netsource/Python-3.7.0/Lib/ctypes/__init__.py", line 7, in <module>
from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
Makefile:1122: recipe for target 'install' failed
make: *** [install] Error 1
解决记录:
- 1 安装依赖包 libffi-dev
abeenserver@abeenserver:~/netsource/Python-3.7.0$ sudo apt-get install libffi-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
libffi-dev : Depends: libffi6 (= 3.2.1-4) but 3.2.1-8 is to be installed
E: Unable to correct problems, you have held broken packages.
- 2 看来libffi-dev 依赖的libffi6版本,本地版本有点高了,还是安装后退安装指定依赖包 libffi6=3.2.1-4 吧
abeenserver@abeenserver:~/netsource/Python-3.7.0$ sudo apt-get install libffi6=3.2.1-4
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be DOWNGRADED:
libffi6
0 upgraded, 0 newly installed, 1 downgraded, 0 to remove and 0 not upgraded.
Need to get 17.8 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://mirrors.ustc.edu.cn/ubuntu xenial/main amd64 libffi6 amd64 3.2.1-4 [17.8 kB]
Fetched 17.8 kB in 2s (9,110 B/s)
dpkg: warning: downgrading libffi6:amd64 from 3.2.1-8 to 3.2.1-4
(Reading database ... 109533 files and directories currently installed.)
Preparing to unpack .../libffi6_3.2.1-4_amd64.deb ...
Unpacking libffi6:amd64 (3.2.1-4) over (3.2.1-8) ...
Setting up libffi6:amd64 (3.2.1-4) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
- 3 再次尝试安装 libffi-dev,成功
abeenserver@abeenserver:~/netsource/Python-3.7.0$ sudo apt-get install libffi-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
libffi-dev
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 161 kB of archives.
After this operation, 365 kB of additional disk space will be used.
Get:1 http://mirrors.ustc.edu.cn/ubuntu xenial/main amd64 libffi-dev amd64 3.2.1-4 [161 kB]
Fetched 161 kB in 0s (434 kB/s)
Selecting previously unselected package libffi-dev:amd64.
(Reading database ... 109533 files and directories currently installed.)
Preparing to unpack .../libffi-dev_3.2.1-4_amd64.deb ...
Unpacking libffi-dev:amd64 (3.2.1-4) ...
Processing triggers for install-info (6.5.0.dfsg.1-2) ...
Setting up libffi-dev:amd64 (3.2.1-4) ...
Processing triggers for man-db (2.8.3-2) ...
- 4 继续配置安装Python3.7,顺利完成!
./configure --enable-shared --enable-loadable-sqlite-extensions --enable-optimizations
make
make test
sudo make install
[Dynamic Language] Python3.7 源码安装 ModuleNotFoundError: No module named '_ctypes' 解决记录的更多相关文章
- Python安装常见问题:ModuleNotFoundError: No module named '_ctypes' 解决办法
一般位于3.7以上版本编译安装时出错 缺少依赖包libffi-devel 在安装3.7以上版本时,需要一个新的libffi-devel包做依赖 解决方法: yum install libffi-dev ...
- centos下安装python3.7.0以上版本时报错ModuleNotFoundError: No module named '_ctypes'
centos下安装python3.7.0以上版本时报错ModuleNotFoundError: No module named '_ctypes'的解决办法 3.7版本需要一个新的包libffi-de ...
- python3.8安装flask出现错误“ModuleNotFoundError: No module named '_ctypes'”
本想在CentOS下配置flask+nginx+uwsgi环境,结果安装最基础的flask包都出了问题...以下是我的环境: 服务器:阿里云ECS CentOS7 python版本:3.8.0 问题描 ...
- redhat 6安装python 3.7.4报错ModuleNotFoundError: No module named '_ctypes' make: *** [install] Error 1
问题描述: 今天在测试环境中,为了执行脚本,安装下python3命令,在执行make install的时候报错: ModuleNotFoundError: No module named '_ctyp ...
- 装新的python3.7时ModuleNotFoundError: No module named '_ctypes'
在编译安装新的python3.7的时候 报错 ModuleNotFoundError: No module named '_ctypes',其实是缺少了一个新需要的开发包libffi-devel,安装 ...
- 报错:ModuleNotFoundError: No module named '_ctypes'
报错背景: CentOS 7 Python3.7 安装 setuptools 插件的时候报错. 报错现象: [root@master setuptools-]# python3. setup.py b ...
- centos7安装python3和Django后,ModuleNotFoundError: No module named '_sqlite3'
1.准备安装环境 yum groupinstall 'Development Tools' yum install zlib-devel bzip2-devel openssl-devel ncurs ...
- CentOS7.5 Python3安装pip报错:ModuleNotFoundError: No module named '_ctypes' --Python3
1.问题:pyhontModuleNotFoundError: No module named '_ctypes' 操作系统:CentOS7.5 安装完Pyhotn3后(如何安装Python3,安装 ...
- python3 使用flask连接数据库出现“ModuleNotFoundError: No module named 'MySQLdb'”
本文链接:https://blog.csdn.net/Granery/article/details/89787348 在使用python3连接MySQL的时候出现了 ‘ModuleNotFoundE ...
随机推荐
- Shell编程学习2--命令大全
Linux中有很多的命令,这些命令可分分为10类(具体参见[1]): 1) 文件管理; 2) 文档编辑; 3) 文件传输; 4) 磁盘管理; 5) 磁盘维护; 6) 网络通讯; 7) 系统管理; 8) ...
- Python版飞机大战
前面学了java用java写了飞机大战这次学完python基础后写了个python版的飞机大战,有兴趣的可以看下. 父类是飞行物类是所有对象的父类,setting里面是需要加载的图片,你可以换称自己的 ...
- linux(vi)常用命令
常用操作 系统命令 查看主机名 hostname 修改主机名(重启后无效) hostname yang 修改主机名(重启后永久生效) vi /ect/sysconfig/network 修改IP(重启 ...
- cvpr densnet论文
- table中的td等长(不随内容大小变化)
使用的table时候发现td的长度是随着内容的大小而变化的,但是有的时候我们不希望这样.想要td等长可以在 tbale中加上 style=“table-layout:fixed” ...
- Github中展示demo
原文链接http://www.jianshu.com/p/75e30889e70a 第一步:找到Settings,点击 第二步:找到githubPages点击none,切换到master branch ...
- JavaScript中构造函数
构造函数:函数的另一种执行方法,执行后创建对象,并创建原型对象. 原型链:对象访问构造函数的指针. Function函数:函数对象. Object函数:所有创建对象的祖辈对象,也是由Function对 ...
- 一个带bash,带glibc,中国时区,非root用户可运行crond命令的基于alpine镜像的Dockerfile
这个镜像现在说起来简单, 带bash(增加执行脚本的兼容性,带GLIBC,中国时区,非root用户可运行crond命令-安全) 但让我开始陷入时,真的让我有段时间有点爆了. 比如,将filebeat文 ...
- HBase(一)HBase入门简介
一 HBase 的起源 HBase 的原型是 Google 的 BigTable 论文,受到了该论文思想的启发,目前作为 Hadoop 的子项目来开发维护,用于支持结构化的数据存储. Apache H ...
- day1作业登录接口总结
作业一:编写登陆接口 1.输入用户名和密码 2.认证成功后显示欢迎信息 3.输错三次后锁定 上面作业,用了几种思路来解决问题:但是本质上其实都是一样的:核心都是对文件的操作,文件的增删改查:并且这些操 ...