0

I am trying to install machine module. The error says:

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
user4157124
  • 2,809
  • 13
  • 27
  • 42
  • I don't know the problem, but from the error message, Did you check these? **GMP or MPIR library not found, Microsoft Visual C++ 14.0 or greater is required**. Also check this question, [How do I install PyCrypto on Windows?](https://stackoverflow.com/questions/11405549/how-do-i-install-pycrypto-on-windows) – Nesi Aug 08 '23 at 11:44
  • 1
    Have you installed MS visual C++ 14, as indicated in the message ? – Itération 122442 Aug 08 '23 at 11:48

1 Answers1

0

There is no need to install the machine package if you're on a Raspberry Pi Pico or any MicroPython device. Simply import the package inside the REPL or your Python file with

import machine
print(machine.freq()) # this will print the device frequency