博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[Dynamic Language] Python3.7 源码安装 ModuleNotFoundError: No module named '_ctypes' 解决记录...
阅读量:6841 次
发布时间:2019-06-26

本文共 3010 字,大约阅读时间需要 10 分钟。

Python3.7 源码安装 ModuleNotFoundError: No module named '_ctypes' 解决记录

源码安装时报错

File "/home/abeenserver/netsource/Python-3.7.0/Lib/ctypes/__init__.py", line 7, in 
from _ctypes import Union, Structure, ArrayModuleNotFoundError: No module named '_ctypes'Makefile:1122: recipe for target 'install' failedmake: *** [install] Error 1

解决记录

  • 1 安装依赖包 libffi-dev
abeenserver@abeenserver:~/netsource/Python-3.7.0$ sudo apt-get install libffi-devReading package lists... DoneBuilding dependency tree       Reading state information... DoneSome packages could not be installed. This may mean that you haverequested an impossible situation or if you are using the unstabledistribution that some required packages have not yet been createdor 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 installedE: 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-4Reading package lists... DoneBuilding dependency tree       Reading state information... DoneThe following packages will be DOWNGRADED:  libffi60 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] YGet: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-devReading package lists... DoneBuilding dependency tree       Reading state information... DoneThe following NEW packages will be installed:  libffi-dev0 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-optimizationsmakemake testsudo make install

转载地址:http://fdzul.baihongyu.com/

你可能感兴趣的文章
css的继承性
查看>>
shell脚本练习(12.12)
查看>>
不得不知的容器生态圈发展趋势
查看>>
二叉树红黑树和B+树
查看>>
OGNL Context结构图
查看>>
软连接;硬链接
查看>>
SpringBoot整合Kafka和Storm
查看>>
硬盘测试——hdparm
查看>>
Linux- 日常运维-nload -网卡流量
查看>>
Linux网络管理
查看>>
俄罗斯***组织APT29被指使用新型恶意软件***美国实体
查看>>
戴尔EMC和VMware产品曝高危漏洞,现已发放补丁
查看>>
欧盟针对14款产品推出漏洞赏金计划
查看>>
大型网站系统架构演化之路
查看>>
学习五十二
查看>>
部署监控三剑客 Cacti 服务器监控
查看>>
ajax工作原理
查看>>
模拟磁盘被节点×××
查看>>
第四课-第二讲04_02_权限及权限管理
查看>>
Python入门小程序(一)
查看>>