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' 解决记录...相关推荐

  1. python3 pip3 install 报错 ModuleNotFoundError: No module named ‘_ctypes‘ 解决方法

    错误: 在腾讯云上pip install sklearn时报这个错误,如下: File "/usr/local/python3/lib/python3.7/ctypes/__init__.p ...

  2. Python安装常见问题:ModuleNotFoundError: No module named ‘_ctypes‘ 解决办法

    Python安装常见问题:ModuleNotFoundError: No module named '_ctypes' 解决办法 参考文章: (1)Python安装常见问题:ModuleNotFoun ...

  3. 安装pytorch时,在安装 future-0.18.2.tar.gz (829 kB)时报错:ModuleNotFoundError: No module named ‘_ctypes’解决办法

    ModuleNotFoundError: No module named '_ctypes' from _ctypes import Union, Structure, Array ModuleNot ...

  4. 关于在centos下安装python3.7.0以上版本时报错ModuleNotFoundError No module named _ctypes 的解决办法

    3.7版本需要一个新的包libffi-devel,安装此包之后再次进行编译安装即可. #yum install libffi-devel -y #make install 若在安装前移除了/usr/b ...

  5. CentOS下安装Python3.7报错ModuleNotFoundError: No module named '_ctypes'的解决方案

    问题复现: 编译安装Python3.7版本,在make install的时候,出现报错 zipimport.ZipImportError: can't decompress data; zlib no ...

  6. ctypes python3.7_装新的python3.7时ModuleNotFoundError: No module named '_ctypes'

    在编译安装新的python3.7的时候 报错 ModuleNotFoundError: No module named '_ctypes',其实是缺少了一个新需要的开发包libffi-devel,安装 ...

  7. ModuleNotFoundError: No module named ‘_ctypes‘的解决方案

    腾讯云Linux服务器上安装Python3时,报错 import ctypesFile "/usr/local/python3/lib/python3.7/ctypes/__init__.p ...

  8. jupyter notebook运行出错:ModuleNotFoundError: No module named ‘keras‘ 解决办法

    接上一篇 <win10+python3.6+tensorflow-cpu+keras+Pycharm环境下的tensorflow配置方法> 通过Anaconda Prompt 打开 查看当 ...

  9. ModuleNotFoundError: No module named ‘matplotlib‘ 解决办法

    问题:ModuleNotFoundError: No module named 'matplotlib' 解决办法: round 1:打开PyCharm,点击File->Settings,点击弹 ...

最新文章

  1. 【开源】分享一个前后端分离方案-前端angularjs+requirejs+dhtmlx 后端asp.net webapi
  2. oculus ios学习资料整理
  3. UA MATH636 信息论9 有限域简介
  4. 西部服务器怎么备份文件,怎么将云服务器数据还原
  5. VTK:图像平移范围用法实战
  6. Linux中VI中看时间,Linux中vi的使用
  7. 微信小程序UI组件、开发框架、实用库...
  8. CocoaPods打包静态库
  9. 一文理解设计模式之--观察者模式(Observer)
  10. js基础知识学习(二)
  11. error: expected expression before ‘struct
  12. 获取点击按钮的元素_Web API - DOM元素属性操作
  13. 2022年最新版黑马程序员Java自学路线(免费分享)
  14. Linux内核启动过程学习
  15. 智慧城市大数据运营中心及城市大脑综合运行管理平台建设方案WORD
  16. 网际风全推数据接口_网际风飞狐全推接口
  17. 2023最新SSM计算机毕业设计选题大全(附源码+LW)之java在线电影院售票系统5u8st
  18. LLVM IRBuilder and pass:1.llvm基础命令
  19. 钻石小鸟:年轻兄妹的百年品牌梦
  20. 汽车销售Spark数据处理和数据分析项目实战Dataframe

热门文章

  1. ArcEngine读取数据(数据访问)-转载
  2. 实战篇-简单多语言的实现
  3. [*开同*看] 星际情书
  4. 翻译介绍15个经典的MDX查询-02and03
  5. 基于Vue+nodejs实现的前后端分离疫情防控系统
  6. Spark源码阅读04-Spark运行架构之Local运行模式
  7. 高软作业三:原型化设计——随心记
  8. bzoj1875 边点互换+矩乘
  9. Linux下各文件夹的结构说明及用途介绍(转载)
  10. 构建一个LVS-DR模型的高性能集群,并实现Nginx、PHP、MySQL分离