Solve the problem of 'error: can't find Rust compiler' when installing docker compose on Raspberry Pi

Operating system: raspberry pi os
Python: Python 3.8.8 (installed by compiling)

>>> pip3 install docker-compose
  • 1
  error: can't find Rust compiler

  If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.

  To update pip, run:

      pip install --upgrade pip

  and then retry package installation.

  If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain.

  This package requires Rust >=1.41.0.
  ----------------------------------------
  ERROR: Failed building wheel for cryptography
Failed to build cryptography
ERROR: Could not build wheels for cryptography which use PEP 517 and cannot be installed directly
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17

Solution:

>>> export CRYPTOGRAPHY_DONT_BUILD_RUST=1
  • 1

Reference: https://github.com/docker/compose/issues/8105#issuecomment-775879420

Related: Solve the problem of 'error: can't find Rust compiler' when installing docker compose on Raspberry Pi