geerlingguy / ansible-role-docker_arm

Ansible Role - Docker for ARM and Pi
MIT License
98 stars 29 forks source link

Install Docker Compose using Pip failes thanks to outdated Rust version 1.48 #37

Closed quantumfate closed 1 year ago

quantumfate commented 2 years ago

I am setting up docker on my old Raspberry Pi 2 Model B Rev 1.1 OS: Raspbian GNU/Linux 11 (bullseye) armv7l Kernel: 5.15.61-v7+ CPU: BCM2835 (4) @ 900MHz

The command pip install docker-compose failes due to an oudated Rust version (1.48) with the following build error:

Building wheels for collected packages: bcrypt
  Building wheel for bcrypt (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for bcrypt (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [46 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-armv7l-cpython-39
      creating build/lib.linux-armv7l-cpython-39/bcrypt
      copying src/bcrypt/__init__.py -> build/lib.linux-armv7l-cpython-39/bcrypt
      copying src/bcrypt/__about__.py -> build/lib.linux-armv7l-cpython-39/bcrypt
      running egg_info
      writing src/bcrypt.egg-info/PKG-INFO
      writing dependency_links to src/bcrypt.egg-info/dependency_links.txt
      writing requirements to src/bcrypt.egg-info/requires.txt
      writing top-level names to src/bcrypt.egg-info/top_level.txt
      reading manifest file 'src/bcrypt.egg-info/SOURCES.txt'
      reading manifest template 'MANIFEST.in'
      warning: no previously-included files found matching 'requirements.txt'
      warning: no previously-included files found matching 'release.py'
      warning: no previously-included files found matching 'mypy.ini'
      warning: no previously-included files matching '*' found under directory '.github'
      warning: no previously-included files matching '*' found under directory '.circleci'
      warning: no previously-included files found matching 'src/_bcrypt/target'
      warning: no previously-included files matching '*' found under directory 'src/_bcrypt/target'
      adding license file 'LICENSE'
      writing manifest file 'src/bcrypt.egg-info/SOURCES.txt'
      copying src/bcrypt/_bcrypt.pyi -> build/lib.linux-armv7l-cpython-39/bcrypt
      copying src/bcrypt/py.typed -> build/lib.linux-armv7l-cpython-39/bcrypt
      running build_ext
      running build_rust

          =============================DEBUG ASSISTANCE=============================
          If you are seeing a compilation error please try the following steps to
          successfully install bcrypt:
          1) Upgrade to the latest pip and try again. This will fix errors for most
             users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
          2) Ensure you have a recent Rust toolchain installed. bcrypt requires
             rustc >= 1.56.0.

          Python: 3.9.2
          platform: Linux-5.15.61-v7+-armv7l-with-glibc2.31
          pip: n/a
          setuptools: 65.3.0
          setuptools_rust: 1.5.1
          rustc: 1.48.0 (471d696c7 2020-12-10)
          =============================DEBUG ASSISTANCE=============================

      error: Rust 1.48.0 does not match extension requirement >=1.56.0
      [end of output]

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

I fixed this by doing the following:

  1. Determine installed Rust packages and uninstall it
    
    dpkg -l | grep rust

sudo apt remove libstd-rust-* sudo apt remove rust-gdb

2. Install the lates stable Rust version
```bash
# Follow the setup with default installation
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  1. Source the new cargo environment
    # Put this into your .bashrc/.zshrc/.fishrc etc
    source "$HOME/.cargo/env"

Now pip install docker-compose completes without errors.

quantumfate commented 2 years ago

I'wouldn't be sure how to fix that, I just put it here to provide a solution

stale[bot] commented 1 year ago

This issue has been marked 'stale' due to lack of recent activity. If there is no further activity, the issue will be closed in another 30 days. Thank you for your contribution!

Please read this blog post to see the reasons why I mark issues as stale.

stale[bot] commented 1 year ago

This issue has been closed due to inactivity. If you feel this is in error, please reopen the issue or file a new issue with the relevant details.