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 .
相关推荐
青少儿编程课堂34 分钟前
蓝桥杯·全国青少年信息素养大赛·电子学会Python/C++考级:Bellman-Ford与SPFA含负权最短路及负环检测全解析
c++·python·算法·bfs·信息学竞赛
小小张说故事1 小时前
Python 的 __init__ 到底是不是构造函数?拆开 __new__ 先造对象、那次被跳过的初始化和必须返回 None 的规矩
python
拖累斯1 小时前
Jenkins + Python 全自动跑通「禅道任务/BUG 导出 → 月度开发考核表」
python·jenkins·bug
j7~1 小时前
【C++ 八股文】(篇四)C++11 新特性
开发语言·c++·面试·c++11·八股文
eggwyw1 小时前
C++中大括号的用法合集
开发语言·c++
xiaoye-duck1 小时前
《C++ 项目:手写大模型接入 SDK》本地 Ollama 部署与适配
开发语言·网络·c++·语言模型
特立独行的猫A1 小时前
13MB 单文件、一条命令变服务:把仓颉写的 cjh 内嵌进你的应用,当它的 AI 大脑
java·后端·python
deepseek232 小时前
Agent任务中途断线,怎么避免重复执行?SQLite检查点实测
python·sqlite·任务调度·幂等性·ai agent
联犀2 小时前
联犀 Go SIMD 实战:视频转码从 16.5ms 到 5.46ms
开发语言·golang·音视频
octopus_c2 小时前
STL 之 string:auto 与范围 for、常用接口、模拟实现与深浅拷贝
开发语言·c++·算法