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 .
相关推荐
二进制漫游记4 分钟前
FastAPI项目集成 Qdrant向量数据库+阿里云Embedding完整实战(工具封装+业务调用)
数据库·python·阿里云·embedding
-今昭-1 小时前
《V2V 迁移实战:将 VMware 虚拟机转为 OpenStack 可用 Glance qcow2 镜像》
开发语言·python
2601_962381581 小时前
【转】Python渗透测试工具:sqlmap
python·渗透测试·sql注入·sqlmap·数据库安全
用户3721574261352 小时前
如何使用 Python 从 Word 文档中提取图片
python
黑马程序员毕设3 小时前
基于Java的医院药品管理系统的优化设计与实现
java·开发语言·spring boot·小程序·架构·课程设计·毕设
白山编程大哥3 小时前
Java 集合算法:从排序、查找到底层原理的实战指南
java·python·算法
_Twink1e3 小时前
openJiuwen 实训营 Day 1 · WorkSwarm 入门教程
开发语言·c++·openjiuwen
问天_观心3 小时前
大模型微调学习(一)
开发语言·人工智能·学习·语言模型·github
阿里嘎多学长4 小时前
2026-09-03 GitHub 热点项目精选
开发语言·程序员·github·代码托管
昭昭日月明4 小时前
RAGFlow 入门,不用从零造轮子
python·ai编程