You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

升级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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.10 12:42:39