1、pip install tensorflow
(waymax) root@e940de6f9d9d:~/waymax# pip install tersorflow
ERROR: Could not find a version that satisfies the requirement tersorflow (from versions: none)
ERROR: No matching distribution found for tersorflow
去网上查阅资料说是python版本对不上,参考官网的python版本:说是要3.6-3.9的python版本使用 pip 安装 TensorFlow (google.cn)
给我整懵了,我在githup上clone的waymax项目要求文件上写着要求python>=3.10, 'tensorflow>=2.11.0',两者不就矛盾了,是我理解错了还是有什么科技,继续探索解决办法,返现原来指定tensorflow的版本既可以成功。
2、pip install tensorflow=2.11.0
因为我的项目文件要求tensorflow的版本不低于2.11.0,故我先尝试2.11.0版本,结果报错如下:
ERROR: Could not find a version that satisfies the requirement grpcio<2.0,>=1.24.3 (from tensorflow) (from versions: none)
ERROR: No matching distribution found for grpcio<2.0,>=1.24.3
这个错误表明在安装 TensorFlow 时无法找到符合要求的 grpcio 版本。根据错误信息,需要的是 grpcio 的版本范围在 1.24.3 到 2.0 之间的版本。查询资料发现不同的python版本对应不同的tensorflow版本:Tensorflow与Python、CUDA、cuDNN的版本对应表_tensorflow版本对应python3.11-CSDN博客但好奇测试了一下换一个tensorflow版本,可能这里别的python版本不适用2.12.0版本,建议自己尝试更换版本安装,总有一个对得上吧。
pip install tensorflow==2.12.0 -i https://pypi.mirrors.ustc.edu.cn/simple/
顺利安装成功,但这里有一个注意的,不切换源的话可能也会报错。看来探索还是需要一点运气。