假设你已经安装好了python
一、安装rust
pkg install rust
二、安装cryptography
1、用国内镜像下载
pip install cryptography -i https://pypi.tuna.tsinghua.edu.cn/simple/
国内镜像:
这里推荐三个非常不错的国内镜像:
https://pypi.tuna.tsinghua.edu.cn/simple/ 清华大学镜像
http://pypi.douban.com/simple/ 豆瓣镜像
http://mirrors.aliyun.com/pypi/simple/ 阿里镜像
2、下载时如果提醒This package requires Rust >=1.41.0. 则执行一,下载rust后,再重新下载cryptography
3、如果提示
error: Don't know the correct rust target for system type aarch64-unknown-linux-android. Please set the CARGO_BUILD_TARGET environment variable
是下载Rust后没有设置环境变量
export CARGO_BUILD_TARGET=aarch64-linux-android
设置后重新执行
pip install cryptography -i https://pypi.tuna.tsinghua.edu.cn/simple/
4、如果提示error是github 443的错误。当前网络不能访问github,我是直接更换了termux的网络,原来用的Wi-Fi,更换成手机流量就可以了,应该也可以更换源镜像之类的,因为下载成功了就没有去研究
参考资料
https://github.com/pyca/cryptography/issues/6610
How to Install Rust on Termux? - GeeksforGeeks
Failed building wheel for Cryptography - Termux - pyca/cryptography

这篇博客介绍了如何在Termux环境下安装Rust和cryptography库。首先,通过pkginstallrust命令安装Rust。然后,使用国内镜像源如清华大学镜像加速pip安装cryptography。如果遇到Rust版本要求或CARGO_BUILD_TARGET环境变量未设置的问题,需相应解决。对于网络问题导致的github访问失败,可以尝试更换网络或镜像源。提供的参考资料包括了相关问题的GitHub讨论和解决方案。
1233

被折叠的 条评论
为什么被折叠?



