pip install pycrypto 错误(子进程退出并出现错误)

问题描述 投票:0回答:1

我正在安装 pycrypto 来编码 AES 128 CBC 算法。 但我得到了这个错误(如图)。我该怎么办?

C:\python\python_InternalLock>pip install pycrypto
Collecting pycrypto
  Downloading pycrypto-2.6.1.tar.gz (446 kB)
     ---------------------------------------- 446.2/446.2 kB 2.3 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: pycrypto
  Building wheel for pycrypto (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [2 lines of output]
      warning: GMP or MPIR library not found; Not building Crypto.PublicKey._fastmath.
      error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pycrypto
  Running setup.py clean for pycrypto
Failed to build pycrypto
ERROR: Could not build wheels for pycrypto, which is required to install pyproject.toml-based projects

pycrypto的错误

搜索了 Microsoft Visual C++ 14.0 和 GMP 或 MPIR 库。但我没有得到这个问题的解决方案。请让我知道如何解决这个问题。

python-3.x pip aes pycrypto cbc
1个回答
0
投票

PyCrypto 2.x 无人维护、过时且包含安全漏洞。

建议您对新应用程序使用 Cryptography,或对依赖于PyCrypto的现有软件使用

PyCryptodome

参见 https://www.pycrypto.org/

© www.soinside.com 2019 - 2024. All rights reserved.