【python】安装python3.7出现ModuleNotFoundError: No module named ‘_ctypes’解决办法

Python 专栏收录该内容
10 篇文章 1 订阅
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

解决方法:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo apt-get install build-essential python-dev python-setuptools python-pip python-smbus
sudo apt-get install build-essential libncursesw5-dev libgdbm-dev libc6-dev
sudo apt-get install zlib1g-dev libsqlite3-dev tk-dev
sudo apt-get install libssl-dev openssl
sudo apt-get install libffi-dev

再重新编译安装python3.7即可成功 。

原问题:https://stackoverflow.com/questions/27022373/python3-importerror-no-module-named-ctypes-when-using-value-from-module-mul

展开阅读全文
  • 2
    点赞
  • 4
    评论
  • 8
    收藏
  • 一键三连
    一键三连
  • 扫一扫,分享海报

相关推荐
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、C币套餐、付费专栏及课程。

余额充值