3

我正在尝试安装 Pyrebase,但我不断收到一个错误,我认为该错误是由 pycryptodome 的 setup.py 引起的。我已经搜索了所有但找不到解决方案,有人知道如何解决这个问题吗?

我的输出如下 - 我在 (...) 的地方添加了截断输出,这是创建和复制库。

谢谢您的帮助

(backend-ragxWAh7) bash-3.2$ pip install Pyrebase
Collecting Pyrebase
 (...)
Building wheels for collected packages: pycryptodome
  Running setup.py bdist_wheel for pycryptodome ... error
  Complete output from command /Users/rafilurie/.local/share/virtualenvs/backend-ragxWAh7/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/d5/zwblxz7d3gxcks_wgjcyxw_00000gn/T/pip-install-q_NyfS/pycryptodome/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /private/var/folders/d5/zwblxz7d3gxcks_wgjcyxw_00000gn/T/pip-wheel-8ox7HU --python-tag cp27:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.14-intel-2.7
  creating build/lib.macosx-10.14-intel-2.7/Crypto
  copying lib/Crypto/__init__.py -> build/lib.macosx-10.14-intel-2.7/Crypto
  (...)
  copying lib/Crypto/SelfTest/Signature/test_vectors/PKCS1-PSS/SigVerPSS_186-3.rsp -> build/lib.macosx-10.14-intel-2.7/Crypto/SelfTest/Signature/test_vectors/PKCS1-PSS
  warning: PCTBuildPy: byte-compiling is disabled, skipping.

  running build_ext
  warning: no support for Intel AESNI instructions
  building 'Crypto.Hash._MD2' extension
  creating build/temp.macosx-10.14-intel-2.7
  creating build/temp.macosx-10.14-intel-2.7/src
  cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -DLTC_NO_ASM -Isrc/ -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/MD2.c -o build/temp.macosx-10.14-intel-2.7/src/MD2.o
  xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
  error: command 'cc' failed with exit status 1

  ----------------------------------------
  Failed building wheel for pycryptodome
  Running setup.py clean for pycryptodome
Failed to build pycryptodome
Installing collected packages: pycryptodome, Pyrebase
  Running setup.py install for pycryptodome ... error
    Complete output from command /Users/rafilurie/.local/share/virtualenvs/backend-ragxWAh7/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/d5/zwblxz7d3gxcks_wgjcyxw_00000gn/T/pip-install-q_NyfS/pycryptodome/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/d5/zwblxz7d3gxcks_wgjcyxw_00000gn/T/pip-record-1TJZWz/install-record.txt --single-version-externally-managed --compile --install-headers /Users/rafilurie/.local/share/virtualenvs/backend-ragxWAh7/include/site/python2.7/pycryptodome:
    running install
    running build
    running build_py
    (...)
    creating build/lib.macosx-10.14-intel-2.7/Crypto/SelfTest/Signature/test_vectors/PKCS1-v1.5
    copying lib/Crypto/SelfTest/Signature/test_vectors/PKCS1-v1.5/SigVer15_186-3.rsp -> build/lib.macosx-10.14-intel-2.7/Crypto/SelfTest/Signature/test_vectors/PKCS1-v1.5
    copying lib/Crypto/SelfTest/Signature/test_vectors/PKCS1-v1.5/SigGen15_186-3.txt -> build/lib.macosx-10.14-intel-2.7/Crypto/SelfTest/Signature/test_vectors/PKCS1-v1.5
    copying lib/Crypto/SelfTest/Signature/test_vectors/PKCS1-v1.5/SigGen15_186-2.txt -> build/lib.macosx-10.14-intel-2.7/Crypto/SelfTest/Signature/test_vectors/PKCS1-v1.5
    creating build/lib.macosx-10.14-intel-2.7/Crypto/SelfTest/Signature/test_vectors/PKCS1-PSS
    copying lib/Crypto/SelfTest/Signature/test_vectors/PKCS1-PSS/SigGenPSS_186-2.txt -> build/lib.macosx-10.14-intel-2.7/Crypto/SelfTest/Signature/test_vectors/PKCS1-PSS
    copying lib/Crypto/SelfTest/Signature/test_vectors/PKCS1-PSS/SigGenPSS_186-3.txt -> build/lib.macosx-10.14-intel-2.7/Crypto/SelfTest/Signature/test_vectors/PKCS1-PSS
    copying lib/Crypto/SelfTest/Signature/test_vectors/PKCS1-PSS/SigVerPSS_186-3.rsp -> build/lib.macosx-10.14-intel-2.7/Crypto/SelfTest/Signature/test_vectors/PKCS1-PSS
    warning: PCTBuildPy: byte-compiling is disabled, skipping.

    running build_ext
    warning: no support for Intel AESNI instructions
    building 'Crypto.Hash._MD2' extension
    creating build/temp.macosx-10.14-intel-2.7
    creating build/temp.macosx-10.14-intel-2.7/src
    cc -fno-strict-aliasing -fno-common -dynamic -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -DLTC_NO_ASM -Isrc/ -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/MD2.c -o build/temp.macosx-10.14-intel-2.7/src/MD2.o
    xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
    error: command 'cc' failed with exit status 1

    ----------------------------------------
Command "/Users/rafilurie/.local/share/virtualenvs/backend-ragxWAh7/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/d5/zwblxz7d3gxcks_wgjcyxw_00000gn/T/pip-install-q_NyfS/pycryptodome/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/d5/zwblxz7d3gxcks_wgjcyxw_00000gn/T/pip-record-1TJZWz/install-record.txt --single-version-externally-managed --compile --install-headers /Users/rafilurie/.local/share/virtualenvs/backend-ragxWAh7/include/site/python2.7/pycryptodome" failed with error code 1 in /private/var/folders/d5/zwblxz7d3gxcks_wgjcyxw_00000gn/T/pip-install-q_NyfS/pycryptodome/
4

2 回答 2

0

pycryptodome从 github安装

进入lib/Crypto/PublicKey

从那里获取RSA.py文件

并将其作为单个文件导入pyerbase.py文件,如import rsa

于 2020-09-22T15:53:50.397 回答
0

您没有有效的 C 编译器环境 ( xcode)。另请参阅:https ://apple.stackexchange.com/questions/254380/macos-mojave-invalid-active-developer-path 。

于 2018-12-03T20:56:30.020 回答