升级pip时安装路径错误引发执行失败问题求助
问题描述
在CI运行器里执行命令:
python -m pip install --upgrade pip wheel
尝试将pip和wheel升级到最新版本时,发现pip被安装到当前工作目录的子目录中,弹出警告:
WARNING: The scripts pip, pip3 and pip3.9 are installed in '/opt/trelby/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
紧接着又触发了错误:
Successfully installed pip-23.2.1 wheel-0.41.2
WARNING: There was an error checking the latest version of pip.
/opt/hostedtoolcache/Python/3.9.18/x64/bin/python: No module named pip.main; 'pip' is a package and cannot be directly executed
相关背景:
- 使用setup-python工具安装的Python
- 该问题仅在Python 3.8和3.9版本中出现,Python 3.10及更高版本无此问题
内容的提问来源于stack exchange,提问作者Jano
相关产品推荐
相关产品推荐

