pip install出现报错ERROR: Cannot set --home and --prefix together

报错信息如下

bash 复制代码
Obtaining file:///home/{username}/source/tt-smi
  Installing build dependencies ... error
  error: subprocess-exited-with-error
  
  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [8 lines of output]
      Collecting setuptools>=43.0.0
        Using cached setuptools-82.0.1-py3-none-any.whl (1.0 MB)
      Collecting wheel
        Using cached wheel-0.47.0-py3-none-any.whl (32 kB)
      Collecting packaging>=24.0
        Using cached packaging-26.2-py3-none-any.whl (100 kB)
      Installing collected packages: setuptools, packaging, wheel
      ERROR: Cannot set --home and --prefix together
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

出现原因是环境变量中配置了PIP_TARGET

移除该环境变量即可

bash 复制代码
unset PIP_TARGET
python -m pip install --editable .

或者

bash 复制代码
env -u PIP_TARGET python -m pip install --editable .
相关推荐
techdashen5 分钟前
Cargo 1.94 开发周期全解析
开发语言·后端·rust
love530love7 分钟前
2026年终极防坑指南:基于 EPGF 架构彻底“本地化” UV 环境与工具
人工智能·windows·python·架构·devops·uv·epgf
charlie11451419114 分钟前
现代C++特性指南——constexpr 构造函数与字面类型
开发语言·c++
北城以北888818 分钟前
虚拟机安装JDK,Tomcat,部署项目
java·开发语言·tomcat
财经资讯数据_灵砚智能18 分钟前
基于全球经济类多源新闻的NLP情感分析与数据可视化(日间)2026年6月12日
人工智能·python·ai·信息可视化·自然语言处理·ai编程·灵砚智能
江华森20 分钟前
Python 3 实战教程:从零基础到项目实战
开发语言·python
Wonderful U24 分钟前
Python+Django实战|在线音乐分享平台:音乐上传、歌手专辑管理、在线播放、自定义歌单、收藏点赞、评论互动
开发语言·python·django
lzjava202428 分钟前
Python的数据结构,推导式、迭代器和生成器
数据结构·windows·python
小糯米60134 分钟前
JavaScript表达式与运算符
开发语言·javascript·ecmascript
北极星日淘37 分钟前
煤炉自动代拍功能开发 | Python 异步任务实现批量下单
开发语言·python·自动化