build Python 3.7.1 時報 ModuleNotFoundError: No module named ‘_ctypes

Traceback (most recent call last):
File "/usr/local/Python-3.7.1/Lib/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/usr/local/Python-3.7.1/Lib/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/usr/local/Python-3.7.1/Lib/ensurepip/__main__.py", line 5, in <module>
sys.exit(ensurepip._main())
File "/usr/local/Python-3.7.1/Lib/ensurepip/__init__.py", line 204, in _main
default_pip=args.default_pip,
File "/usr/local/Python-3.7.1/Lib/ensurepip/__init__.py", line 117, in _bootstrap
return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
File "/usr/local/Python-3.7.1/Lib/ensurepip/__init__.py", line 27, in _run_pip
import pip._internal
File "/tmp/tmp3puswscu/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/__init__.py", line 42, in <module>
File "/tmp/tmp3puswscu/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/cmdoptions.py", line 16, in <module>
File "/tmp/tmp3puswscu/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/index.py", line 25, in <module>
File "/tmp/tmp3puswscu/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/download.py", line 39, in <module>
File "/tmp/tmp3puswscu/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/utils/glibc.py", line 3, in <module>
File "/usr/local/Python-3.7.1/Lib/ctypes/__init__.py", line 7, in <module>
from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
make: *** [install] Error 1
[root@eventmanagement Python-3.7.1]#

 

查了一下,這個是因為少安裝了 libffi-devel ,直接透過 yum install libffi-devel 安裝後再試就成功了.

 

Author: jerryw1974

learning and focus on computer science, cloud infrastructure, virtualization and information security, technical, networking,platform system and cyber-security related topic.