Python 3.11 is not available as apt package on debian raspbian bullseye so installing from source needed
updatepython2v11.sh can be used to compile python 3.11 on raspberry pi
installing packages like bcrypt and cryptography needs rust compiling so rust compiler needed if you don't do that you will get error liek this:
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
╰─> [59 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-aarch64-cpython-311
creating build/lib.linux-aarch64-cpython-311/bcrypt
copying src/bcrypt/__init__.py -> build/lib.linux-aarch64-cpython-311/bcrypt
copying src/bcrypt/__about__.py -> build/lib.linux-aarch64-cpython-311/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-aarch64-cpython-311/bcrypt
copying src/bcrypt/py.typed -> build/lib.linux-aarch64-cpython-311/bcrypt
running build_ext
running build_rust
error: command failed: 'rustc': No such file or directory (os error 2)
=============================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.11.1
platform: Linux-6.1.19-v8+-aarch64-with-glibc2.31
pip: n/a
setuptools: 67.6.0
setuptools_rust: 1.5.2
rustc: n/a
=============================DEBUG ASSISTANCE=============================
error: can't find Rust compiler
apt-get install rustc won't work because it is an old version too. it needs versions higher than 1.56 therefore rust can be installed like this:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
problem with rust installer is it's default is arm64 but raspberry pi works 32 bit so the architecture is detected wrong , so the default settings don't work
if you end up with default settings when your run rust compiler like:
rustc -V
you will get an error like:
error: command failed: 'rustc': No such file or directory (os error 2)
to fix and properly install you need to select option 2 (2) Customize installation) and default host triple must be
armv7-unknown-linux-gnueabihf