小编Kev*_*ong的帖子

为 Python 3.7 安装 libffi-dev 时出现问题

当尝试在 Ubuntu 系统上以桌面模式安装 pgadmin4 时,我收到了 _ctypes 的 ModuleNotFoundError。

我做了一些研究,发现 _ctypes 需要安装 libffi-dev 包。然而,似乎 libffi-dev 和 _ctypes 是为 Python 2.7 安装的,当我运行 import ctypes 时,它似乎可以工作:

$ python2
Python 2.7.15+ (default, Nov 27 2018, 23:36:35) 
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ctypes
>>> 

Run Code Online (Sandbox Code Playgroud)

当我尝试对 Python 3.7 执行相同操作时,它不起作用:

$ python
Python 3.7.3 (default, Jun 21 2019, 12:46:58) 
[GCC 7.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ctypes
Traceback (most …
Run Code Online (Sandbox Code Playgroud)

ubuntu ctypes libffi python-3.x

5
推荐指数
1
解决办法
1万
查看次数

标签 统计

ctypes ×1

libffi ×1

python-3.x ×1

ubuntu ×1