pythonでSSH経由のコマンド実行したくて、ラズパイにparamikoをインストールしようとしたんですが
bcryptのインストールで詰まってインストールできない事象が発生してました。
いろいろ調べてなんとか解消できたので備忘録メモ
環境
OS
$ lsb_release -a
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 10 (buster)
Release: 10
Codename: buster
python
$ python3 --version
Python 3.7.3
実施内容
bcryptのインストール
$ pip3 install bcrypt
※もしくは pip install bcrypt
エラー出力
error: subprocess-exited-with-error 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
bcryptのビルドに失敗しているっぽいエラーが出ました。
もう少し上のデバッグログを見ると、こんな感じの出力が。
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.7.3
platform: Linux-5.10.17-v7l+-armv7l-with-debian-10.9
pip: n/a
setuptools: 65.5.1
setuptools_rust: 1.5.2
rustc: n/a
どうやらrustcなるものが足りないって怒られているようです。
rustcのインストール
![](https://qiita-user-contents.imgix.net/https%3A%2F%2Fcdn.qiita.com%2Fassets%2Fpublic%2Farticle-ogp-background-412672c5f0600ab9a64263b751f1bc81.png?ixlib=rb-4.0.0&w=1200&mark64=aHR0cHM6Ly9xaWl0YS11c2VyLWNvbnRlbnRzLmltZ2l4Lm5ldC9-dGV4dD9peGxpYj1yYi00LjAuMCZ3PTk3MiZoPTM3OCZ0eHQ9JTIwVWJ1bnR1JUUzJTgxJUFCUnVzdCVFMyU4MiU5MiVFMyU4MiVBNCVFMyU4MyVCMyVFMyU4MiVCOSVFMyU4MyU4OCVFMyU4MyVCQyVFMyU4MyVBQiVFMyU4MSU5OSVFMyU4MiU4QiZ0eHQtYWxpZ249bGVmdCUyQ3RvcCZ0eHQtY29sb3I9JTIzMjEyMTIxJnR4dC1mb250PUhpcmFnaW5vJTIwU2FucyUyMFc2JnR4dC1zaXplPTU2JnM9OWE3NjRjNGFkNjRhOWM5MjEwZjdiN2IxMTM1M2Q0OWM&mark-x=142&mark-y=57&blend64=aHR0cHM6Ly9xaWl0YS11c2VyLWNvbnRlbnRzLmltZ2l4Lm5ldC9-dGV4dD9peGxpYj1yYi00LjAuMCZoPTc2Jnc9NzcwJnR4dD0lNDB5b3NoaXlhc3UxMTExJnR4dC1jb2xvcj0lMjMyMTIxMjEmdHh0LWZvbnQ9SGlyYWdpbm8lMjBTYW5zJTIwVzYmdHh0LXNpemU9MzYmdHh0LWFsaWduPWxlZnQlMkN0b3Amcz1mMzYwODY3Yzk5ODA2NGEyYTliYTIwNWVmNDU3NTkyNA&blend-x=142&blend-y=486&blend-mode=normal&s=0aa52f4a4317279d5534cd22f799dcf6)
UbuntuにRustをインストールする - Qiita
UbuntuにRustをインストールしたのでメモとして残しておきます。この記事ではUbuntu18.04にRust1.34.0を入れた記事になっています。Ubuntu22.04にRust1.62.0…
こちらの記事をそのまま参照しました。
$ curl https://sh.rustup.rs -sSf | sh 1) Proceed with installation (default) 2) Customize installation 3) Cancel installation # 1を選択
問題がなければ正常にインストールできるはず。
あとは環境変数の設定をしてあげればOKです。
$ source $HOME/.cargo/env
以上設定を行って再度pip install bcryptを実施したところ問題なくインストール完了しました。
コメント