1

我正在尝试在运行 Fedora 服务器的树莓上安装 discord.py,但是在尝试安装 PyNaCl 时遇到了问题。Pip 抛出一个错误,坦率地说我根本无法理解

  Using cached https://files.pythonhosted.org/packages/61/ab/2ac6dea8489fa713e2b4c6c5b549cc962dd4a842b5998d9e80cf8440b7cd/PyNaCl-1.3.0.tar.gz
  Installing build dependencies ... error
  Complete output from command /usr/bin/python3 -m pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-yrmcivln --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel "cffi>=1.4.1; python_implementation != 'PyPy'":
  Collecting setuptools
    Using cached https://files.pythonhosted.org/packages/d1/6a/4b2fcefd2ea0868810e92d519dacac1ddc64a2e53ba9e3422c3b62b378a6/setuptools-40.8.0-py2.py3-none-any.whl
  Collecting wheel
    Using cached https://files.pythonhosted.org/packages/96/ba/a4702cbb6a3a485239fbe9525443446203f00771af9ac000fa3ef2788201/wheel-0.33.1-py2.py3-none-any.whl
  Collecting cffi>=1.4.1
    Using cached https://files.pythonhosted.org/packages/64/7c/27367b38e6cc3e1f49f193deb761fe75cda9f95da37b67b422e62281fcac/cffi-1.12.2.tar.gz
  Collecting pycparser (from cffi>=1.4.1)
    Using cached https://files.pythonhosted.org/packages/68/9e/49196946aee219aead1290e00d1e7fdeab8567783e83e1b9ab5585e6206a/pycparser-2.19.tar.gz
  Installing collected packages: setuptools, wheel, pycparser, cffi
    Running setup.py install for pycparser: started
      Running setup.py install for pycparser: finished with status 'done'
    Running setup.py install for cffi: started
      Running setup.py install for cffi: finished with status 'error'
      Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-hvzwh_xy/cffi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-sq8m4eeo/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-yrmcivln --compile:
      running install
      running build
      running build_py
      creating build
      creating build/lib.linux-aarch64-3.7
      creating build/lib.linux-aarch64-3.7/cffi
      copying cffi/recompiler.py -> build/lib.linux-aarch64-3.7/cffi
      copying cffi/verifier.py -> build/lib.linux-aarch64-3.7/cffi
      copying cffi/cffi_opcode.py -> build/lib.linux-aarch64-3.7/cffi
      copying cffi/setuptools_ext.py -> build/lib.linux-aarch64-3.7/cffi
      copying cffi/__init__.py -> build/lib.linux-aarch64-3.7/cffi
      copying cffi/lock.py -> build/lib.linux-aarch64-3.7/cffi
      copying cffi/api.py -> build/lib.linux-aarch64-3.7/cffi
      copying cffi/vengine_gen.py -> build/lib.linux-aarch64-3.7/cffi
      copying cffi/pkgconfig.py -> build/lib.linux-aarch64-3.7/cffi
      copying cffi/ffiplatform.py -> build/lib.linux-aarch64-3.7/cffi
      copying cffi/cparser.py -> build/lib.linux-aarch64-3.7/cffi
      copying cffi/backend_ctypes.py -> build/lib.linux-aarch64-3.7/cffi
      copying cffi/error.py -> build/lib.linux-aarch64-3.7/cffi
      copying cffi/commontypes.py -> build/lib.linux-aarch64-3.7/cffi
      copying cffi/model.py -> build/lib.linux-aarch64-3.7/cffi
      copying cffi/vengine_cpy.py -> build/lib.linux-aarch64-3.7/cffi
      copying cffi/_cffi_include.h -> build/lib.linux-aarch64-3.7/cffi
      copying cffi/parse_c_type.h -> build/lib.linux-aarch64-3.7/cffi
      copying cffi/_embedding.h -> build/lib.linux-aarch64-3.7/cffi
      copying cffi/_cffi_errors.h -> build/lib.linux-aarch64-3.7/cffi
      running build_ext
      building '_cffi_backend' extension
      creating build/temp.linux-aarch64-3.7
      creating build/temp.linux-aarch64-3.7/c
      gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -fasynchronous-unwind-tables -fstack-clash-protection -D_GNU_SOURCE -fPIC -fwrapv -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -fPIC -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/python3.7m -c c/_cffi_backend.c -o build/temp.linux-aarch64-3.7/c/_cffi_backend.o
      c/_cffi_backend.c:2:10: fatal error: Python.h: No such file or directory
       #include <Python.h>
                ^~~~~~~~~~
      compilation terminated.
      error: command 'gcc' failed with exit status 1

      ----------------------------------------
  Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-hvzwh_xy/cffi/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-sq8m4eeo/install-record.txt --single-version-externally-managed --prefix /tmp/pip-build-env-yrmcivln --compile" failed with error code 1 in /tmp/pip-install-hvzwh_xy/cffi/

  ----------------------------------------
Command "/usr/bin/python3 -m pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-yrmcivln --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- setuptools wheel "cffi>=1.4.1; python_implementation != 'PyPy'"" failed with error code 1 in None

我尝试过的一些事情是查看我是否已经安装了 libsodium(我已经安装了)。我尝试在 venv 中运行 pip install PyNaCl,但这也不起作用。我尝试安装 libffi-devel 以查看是否没有它,但这并没有解决问题。PyNaCl 的自述文件也说可以运行SODIUM_INSTALL=system python3 -m pip install pynacl,但这也无济于事。这里发生了什么?

4

0 回答 0