在Raspbian上安装Python 3.7.0失败,出现ModuleNotFoundError:没有名为“ _ctypes”的模块

时间:2018-07-05 09:22:46

标签: python python-3.x installation

我从https://gist.github.com/BMeu/af107b1f3d7cf1a2507c9c6429367a3b创建/更新了一个脚本,以在我的Raspberry Pi的Raspian系统上安装Python 3.7.0。该脚本https://gist.github.com/SeppPenner/6a5a30ebc8f79936fa136c524417761d失败

rm /usr/local/lib/python3.7/lib-dynload/_sysconfigdata_m_linux_arm-linux-gnueabihf.py
rm -r /usr/local/lib/python3.7/lib-dynload/__pycache__
/usr/bin/install -c -m 644 ./Misc/python.man \
        /usr/local/share/man/man1/python3.7.1
if test "xupgrade" != "xno"  ; then \
        case upgrade in \
                upgrade) ensurepip="--altinstall --upgrade" ;; \
                install|*) ensurepip="--altinstall" ;; \
        esac; \
         ./python -E -m ensurepip \
                $ensurepip --root=/ ; \
fi
Traceback (most recent call last):
  File "/home/pi/Python-3.7.0/Lib/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/pi/Python-3.7.0/Lib/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/pi/Python-3.7.0/Lib/ensurepip/__main__.py", line 5, in <module>
    sys.exit(ensurepip._main())
  File "/home/pi/Python-3.7.0/Lib/ensurepip/__init__.py", line 204, in _main
    default_pip=args.default_pip,
  File "/home/pi/Python-3.7.0/Lib/ensurepip/__init__.py", line 117, in _bootstrap
    return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
  File "/home/pi/Python-3.7.0/Lib/ensurepip/__init__.py", line 27, in _run_pip
    import pip._internal
  File "/tmp/tmpzno7ofej/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/__init__.py", line 42, in <module>
  File "/tmp/tmpzno7ofej/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/cmdoptions.py", line 16, in <module>
  File "/tmp/tmpzno7ofej/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/index.py", line 25, in <module>
  File "/tmp/tmpzno7ofej/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/download.py", line 39, in <module>
  File "/tmp/tmpzno7ofej/pip-10.0.1-py2.py3-none-any.whl/pip/_internal/utils/glibc.py", line 3, in <module>
  File "/home/pi/Python-3.7.0/Lib/ctypes/__init__.py", line 7, in <module>
    from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
Makefile:1132: die Regel für Ziel âaltinstallâ scheiterte
make: *** [altinstall] Fehler 1

有人对此失败有解决方案吗?

0 个答案:

没有答案