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 .
相关推荐
张张123y6 小时前
后端第一课:输入 URL 后发生了什么?我用手写 Socket 把全链路跑通了
python·websocket·ai·socket·url·后端开发
白帽攻防录8 小时前
SRC 挖洞:PostScript 打印机驱动双 RCE,打印服务器怎么变成内网跳板
开发语言·网络安全·php·内网安全
十年Java程序媛8 小时前
Java枚举Enum完整教程|替代静态常量,开发与面试要点
java·开发语言·spring boot·后端·面试
全栈弄潮儿8 小时前
Python实战第7期:字典与集合
后端·python·编程语言
2603_965148118 小时前
电商选品调研:通过关键词搜索API获取市场热销商品,结合商品详情API分析竞品卖点与定价
开发语言·数据库·人工智能·python·信息可视化
xixiaoyunya9 小时前
Python 异步编程入门:用 asyncio 轻松实现并发任务
开发语言·python·php
把我格子衫拿来9 小时前
Dice 很高就够了吗?分割评价中的 IoU、表面距离与 HD95
python·图像分割·模型评估·医学影像·dice
学逆向的9 小时前
C 循环结构的执行效率分析
c语言·开发语言·数据结构·网络安全
曲径海盗10 小时前
【Python 学习第 31 天】复习:变量与数据类型 等 3 题
python·学习笔记·编程入门
Data_Journal10 小时前
如何绕过 Cloudflare:网页抓取的最佳方法
网络·python