Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install ERROR: Cannot set --home and --prefix together #11129

Open
1 task done
malikmajai opened this issue May 19, 2022 · 10 comments
Open
1 task done

Install ERROR: Cannot set --home and --prefix together #11129

malikmajai opened this issue May 19, 2022 · 10 comments
Labels
S: awaiting response Waiting for a response/more information type: support User Support

Comments

@malikmajai
Copy link

malikmajai commented May 19, 2022

Description

I am getting the error even I am not using --home or --prefix while installing a git repo!

Collecting git+https://github.com/mccoderpy/discord.py-message-components.git@developer
  Cloning https://github.com/mccoderpy/discord.py-message-components.git (to revision developer) to c:\users\rizwan computers\appdata\local\temp\pip-req-build-cajtzut0
  Running command git clone --filter=blob:none --quiet https://github.com/mccoderpy/discord.py-message-components.git 'C:\Users\Rizwan computers\AppData\Local\Temp\pip-req-build-cajtzut0'
  Running command git checkout -b developer --track origin/developer
  branch 'developer' set up to track 'origin/developer'.
  Switched to a new branch 'developer'
  Resolved https://github.com/mccoderpy/discord.py-message-components.git to commit cc5391b50830c3169388d80979fcd4ea7919d273
  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>=40.8.0
        Using cached setuptools-62.3.2-py3-none-any.whl (1.2 MB)
      Collecting wheel
        Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
      Installing collected packages: wheel, setuptools
      ERROR: Cannot set --home and --prefix together
      WARNING: You are using pip version 22.0.4; however, version 22.1 is available.
      You should consider upgrading via the 'C:\Users\Rizwan computers\AppData\Local\Programs\Python\Python39\python.exe -m pip install --upgrade pip' command.
      [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.
WARNING: You are using pip version 22.0.4; however, version 22.1 is available.
You should consider upgrading via the 'C:\Users\Rizwan computers\AppData\Local\Programs\Python\Python39\python.exe -m pip install --upgrade pip' command.

Expected behavior

A successful installation! Like I can install on my other pc via pip.

pip version

22.0.4

Python version

3.9.12

OS

Windows

How to Reproduce

python -m pip install git+https://github.com/mccoderpy/discord.py-message-components.git@developer
Collecting git+https://github.com/mccoderpy/discord.py-message-components.git@developer
  Cloning https://github.com/mccoderpy/discord.py-message-components.git (to revision developer) to c:\users\rizwan computers\appdata\local\temp\pip-req-build-cajtzut0
  Running command git clone --filter=blob:none --quiet https://github.com/mccoderpy/discord.py-message-components.git 'C:\Users\Rizwan computers\AppData\Local\Temp\pip-req-build-cajtzut0'
  Running command git checkout -b developer --track origin/developer
  branch 'developer' set up to track 'origin/developer'.
  Switched to a new branch 'developer'
  Resolved https://github.com/mccoderpy/discord.py-message-components.git to commit cc5391b50830c3169388d80979fcd4ea7919d273
  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>=40.8.0
        Using cached setuptools-62.3.2-py3-none-any.whl (1.2 MB)
      Collecting wheel
        Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
      Installing collected packages: wheel, setuptools
      ERROR: Cannot set --home and --prefix together
      WARNING: You are using pip version 22.0.4; however, version 22.1 is available.
      You should consider upgrading via the 'C:\Users\Rizwan computers\AppData\Local\Programs\Python\Python39\python.exe -m pip install --upgrade pip' command.
      [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.
WARNING: You are using pip version 22.0.4; however, version 22.1 is available.
You should consider upgrading via the 'C:\Users\Rizwan computers\AppData\Local\Programs\Python\Python39\python.exe -m pip install --upgrade pip' command.

Output

No response

Code of Conduct

@malikmajai malikmajai added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels May 19, 2022
@oneextrafact
Copy link

Hi - getting this same message when I try to use pip for certain libraries in a 'dev container' within Visual Studio Code. I'm not supplying either --home or --prefix options.

@malikmajai
Copy link
Author

malikmajai commented Jun 23, 2022 via email

@oneextrafact
Copy link

Hmm interesting. I had to change my devcontainer.json to use sudo pip3, which I guess gave it permission to write to the user directory.

@toxicpanacea
Copy link

I had this issue too. To solve it, you could avoid using 'pip', which installs packages globally. An option is to use 'conda' to install packages to the current env. This perfectly solved my problem, which I think was due to the conflict between global env and current env.

@pafloxy
Copy link

pafloxy commented May 29, 2023

I'm facing same isuue in Ubuntu 22.04. Can someone suggest some workarounds to this ?

@pradyunsg
Copy link
Member

Please paste the output of pip config debug here. This is likely due to misconfiguration of pip, which is breaking the use of isolated builds in pip (the "pip subprocess").

@pradyunsg pradyunsg added type: support User Support S: awaiting response Waiting for a response/more information and removed type: bug A confirmed bug or unintended behavior S: needs triage Issues/PRs that need to be triaged labels May 29, 2023
@pafloxy
Copy link

pafloxy commented Jun 1, 2023

Please paste the output of pip config debug here. This is likely due to misconfiguration of pip, which is breaking the use of isolated builds in pip (the "pip subprocess").

Hi @pradyunsg ! thank you for your concern here is the information you wanted, I am sorry for the delay in my reply! :)

env_var:
env:
global:
  /etc/xdg/xdg-ubuntu/pip/pip.conf, exists: False
  /etc/xdg/pip/pip.conf, exists: False
  /etc/pip.conf, exists: False
site:
  /usr/pip.conf, exists: False
user:
  /home/pafloxy/.pip/pip.conf, exists: False
  /home/pafloxy/.config/pip/pip.conf, exists: True
    global.target: /usr/local/lib/python3.10/dist-packages

image

@pfmoore
Copy link
Member

pfmoore commented Jun 1, 2023

Having global.target set is extremely likely to cause problems, and it's not something I would recommend. Why is it set? (If you don't know, then the first step would be to find out, and ideally work out a better way to achieve the same result).

As it stands, it looks like that global.target is trying to force installation into a weird directory (dist-packages is usually reserved for system use, but /usr/local is for users, as far as I understand it, but I'm not a Linux expert). So I'm pretty sure that's your issue.

@yanwenzhou
Copy link

所以说要怎么解决这个问题啊,有答案吗?
so how to solve this problem? teach me please

@yanwenzhou
Copy link

pip config debug, find the folder
delete the target from pip.ini
problem solved!

@ichard26 ichard26 mentioned this issue May 5, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S: awaiting response Waiting for a response/more information type: support User Support
Projects
None yet
Development

No branches or pull requests

7 participants