前言:
今天创建了一个虚拟环境,之后装了一个ray的,结果报错
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
clearpath-config 1.3.3 requires importlib-metadata, which is not installed.
generate-parameter-library-py 0.5.0 requires jinja2, which is not installed.
generate-parameter-library-py 0.5.0 requires typeguard, which is not installed.
上述的这些包和我要装的包一毛钱关系都没有,到底是什么问题呢?
原因:
我在~/.bashrc里面有
source /opt/ros/humble/setup.bash
这样导致
echo $PYTHONPATH
结果中

由于pip安装包的时候会检查pip list的包,而pip list找包的路径包括了PYTHONPATH这个环境变量,这样导致虚拟空间里面有很多不应该存在的包。
这样在pip安装包的时候,会检查依赖关系,发现有些包的依赖关系不满足,所以报错了。