classification
Title: ModuleNotFoundError: No module named '_ctypes' when install Python 3.7 on Linux
Type: Stage: resolved
Components: Installation Versions: Python 3.7
process
Status: closed Resolution: out of date
Dependencies: Superseder: make install fails: no module _ctypes
View: 31652
Assigned To: Nosy List: iritkatriel, martin.panter, semkin
Priority: normal Keywords:

Created on 2018-07-03 19:10 by semkin, last changed 2021-10-19 23:03 by iritkatriel. This issue is now closed.

Messages (3)
msg320998 - (view) Author: Semyon Levin (semkin) Date: 2018-07-03 19:10
make install failed with
  File "/tmp/tmp2gwe2ma_/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/utils/glibc.py", line 3, in <module>
  File "/common/dev/slevin/tools/Python-3.7.0/Lib/ctypes/__init__.py", line 7, in <module>
    from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
make: *** [install] Error 1

I used PKG_CONFIG_PATH in config and LIBFFI_INCLUDEDIR was created correctly in Makefile. 

How to configure location for libffi.a ?
msg321252 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2018-07-08 03:40
Ctypes is meant to be (at least it used to be) an optional module. If you don’t actually care about building ctypes, this might be the same as Issue 31652. Using “configure --without-ensurepip” was suggested as a workaround.

If you do want ctypes to be built, I would look for compiler and linker messages relating to the “_ctypes” module (before the install step).
msg404374 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-10-19 23:03
3.7 is no longer maintained. Please create a new issue if you are still having this problem with a current version of python (3.9+).
History
Date User Action Args
2021-10-19 23:03:28iritkatrielsetstatus: open -> closed

nosy: + iritkatriel
messages: + msg404374

resolution: out of date
stage: resolved
2018-07-08 03:40:15martin.pantersetsuperseder: make install fails: no module _ctypes

messages: + msg321252
nosy: + martin.panter
2018-07-03 19:11:23semkinsetcomponents: + Installation
versions: + Python 3.7
2018-07-03 19:10:48semkincreate