问题描述
在执行pip install -r requirements.txt
时,遇到如下错误:
ERROR:pip’s dependency resolver dose not currently take into account all the packages that are installed.This behaviour is the source of the following dependency conflicts.
streamlit 1.32.0 requires protobuf<5,>=3.20,but you have protobuf 3.6.0 which if incompatible.
原因分析:
pip的依赖解析程序当前没有考虑所有已安装的包,这种行为是以下依赖冲突的根源:streamlit 1.32.0要求protobuf<5,>=3.20,但您有protobuf 3.6.0
也就是说,安装的包与原有的包版本不匹配。
解决方案:
卸载不兼容的包。
pip uninstall protobuf
根据error描述,下载版本兼容的包。
pip install protobuf==3.20