忘机山人
懒猫 ENV 查看器第二版更新的时候,审核人员和我说遇到了这个错误。说来也奇怪,都用了 docker 了,也会遇到依赖的问题。  https://appstore.lazycat.cloud/#/shop/detail/xu.deploy.env > ERROR: THESE PACKAGES DO NOT MATCH THE HASHES FROM THE REQUIREMENTS FILE Expected sha256 4ceb... Got 5519987f... 因为 pip 在校验阶段就失败,后面的 Flask 等依赖都没装上,于是程序启动时报 ModuleNotFoundError: No module named 'flask'。 最后我还是替换掉了腾讯云。以清华源为主,其他源为辅: ```bash #!/bin/sh # 切换到当前目录 cd "$(dirname "$0")" sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories apk update apk add python3 py3-pip # 设一条主索引(可选) pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple # 给同一个键追加多条 extra-index-url pip config set global.extra-index-url https://mirrors.aliyun.com/pypi/simple/ pip config set global.extra-index-url https://repo.huaweicloud.com/repository/pypi/simple/ pip config set global.extra-index-url https://mirrors.cloud.tencent.com/pypi/simple/ pip install -r ./requirements.txt --break-system-packages python3 app.py ``` 网上还有几种办法,后面再遇到的时候可以再尝试: 1. --no-cache-dir 2. pip cache purge 3. pip install --trusted-host=pypi.org --trusted-host=files.pythonhosted.org example_package 4. rm ~/.cache/pip -rf 5. 关闭机器代理 参考链接: https://stackoverflow.com/questions/71435874/pip-these-packages-do-not-match-the-hashes-from-the-requirements-file
评论
0暂无评论