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 .
相关推荐
Poo_Chai6 分钟前
QT emit信号后完整处理流程,包括槽函数响应流程
java·开发语言·数据库
瑞码空间13 分钟前
Java 图形界面(GUI)完整知识点手册
java·开发语言·图形界面·swing
卷无止境36 分钟前
FastAPI Guard 全解析,从概念到工程落地的实战指南
后端·python
卷无止境41 分钟前
FastAPI Users 全面解析:概念、原理与工程实战
后端·python
小努蛋1 小时前
linux编译openresty异常问题,lua_cjson.c:706:5: 错误: ‘for‘ 循环初始化声明只在 C99 或 C++ 模式下允许
开发语言·lua·openresty
qz_Serene1 小时前
C++:类和对象(上)
开发语言·c++
COOLMO研究AI1 小时前
Python 如何在 AI 接口中实现请求幂等性:防止重复提交与重复扣费
人工智能·python·php
CTA量化套保1 小时前
新手学量化,先做能复查的小流程
人工智能·python
西安景驰电子2 小时前
《PTP精确时间协议系列》第一篇:从原理到应用,全面解读IEEE 1588
linux·运维·服务器·开发语言·网络·windows·php
ctlover2 小时前
Python文件操作
开发语言·python