安装机器模块时无法构建pycrypto

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

我正在尝试安装机器模块。错误说:

Collecting machine
  Using cached machine-0.0.1-py2.py3-none-any.whl (4.2 kB)
Collecting pycrypto (from machine)
  Using cached pycrypto-2.6.1.tar.gz (446 kB)
  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
micropython pycrypto raspberry-pi-pico
1个回答
0
投票

如果您使用的是 Raspberry Pi Pico 或任何 MicroPython 设备,则无需安装

machine
软件包。只需使用

将包导入 REPL 或 Python 文件中
import machine
print(machine.freq()) # this will print the device frequency
© www.soinside.com 2019 - 2024. All rights reserved.