安装python3.7出现ModuleNotFoundError: No module named '_ctypes'解决办法
程序员文章站
2024-03-08 10:37:34
...
在编译python3.7的时候,make没有报错,但是在编译的时候报 ModuleNotFoundError: No module named ‘_ctypes’ 错误
Traceback (most recent call last):
File "/home/wfq/soft/Python-3.7.0b3/Lib/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
File "/home/wfq/soft/Python-3.7.0b3/Lib/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/home/wfq/soft/Python-3.7.0b3/Lib/ensurepip/__main__.py", line 5, in <module>
sys.exit(ensurepip._main())
File "/home/wfq/soft/Python-3.7.0b3/Lib/ensurepip/__init__.py", line 204, in _main
default_pip=args.default_pip,
File "/home/wfq/soft/Python-3.7.0b3/Lib/ensurepip/__init__.py", line 117, in _bootstrap
return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
File "/home/wfq/soft/Python-3.7.0b3/Lib/ensurepip/__init__.py", line 27, in _run_pip
import pip
File "/tmp/tmpnfe1bbxk/pip-9.0.3-py2.py3-none-any.whl/pip/__init__.py", line 45, in <module>
File "/tmp/tmpnfe1bbxk/pip-9.0.3-py2.py3-none-any.whl/pip/vcs/mercurial.py", line 9, in <module>
File "/tmp/tmpnfe1bbxk/pip-9.0.3-py2.py3-none-any.whl/pip/download.py", line 36, in <module>
File "/tmp/tmpnfe1bbxk/pip-9.0.3-py2.py3-none-any.whl/pip/utils/glibc.py", line 4, in <module>
File "/home/wfq/soft/Python-3.7.0b3/Lib/ctypes/__init__.py", line 7, in <module>
from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
make: *** [install] Error 1
解决方法:
yum -y install libffi-devel tk-devel
安装好以后,重新执行 make install 即可。
上一篇: 正确的python画图方式
推荐阅读
-
安装python3.7出现ModuleNotFoundError: No module named '_ctypes'解决办法
-
VScode出现ModuleNotFoundError: No module named ‘tensorflow‘问题解决办法
-
Python3中无法导入ssl模块的解决办法和python3.7 ModuleNotFoundError: No module named bz2解决办法
-
CentOS下安装Python3.7报错ModuleNotFoundError: No module named '_ctypes'的解决方案
-
解决:在centos7中安装python3.7.0时,ModuleNotFoundError: No module named '_ctypes'报错
-
Python3中无法导入ssl模块的解决办法和python3.7 ModuleNotFoundError: No module named bz2解决办法