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

Poetry fails to run pip which picks user option from user config #6521

Closed
3 tasks done
sergei-dyshel opened this issue Sep 15, 2022 · 10 comments · Fixed by #6531
Closed
3 tasks done

Poetry fails to run pip which picks user option from user config #6521

sergei-dyshel opened this issue Sep 15, 2022 · 10 comments · Fixed by #6531
Labels
area/installer Related to the dependency installer kind/bug Something isn't working as expected version/1.2.0

Comments

@sergei-dyshel
Copy link

sergei-dyshel commented Sep 15, 2022

Issue

I have pip configured to install to user directory:

# pip.conf
[global]
user = yes

When I install project with poetry I get the following error:

# poetry install
  Command ['/Users/sergei/Library/Caches/pypoetry/virtualenvs/itunes-tag-sync-_c69w8Vl-py3.10/bin/python', '/usr/local/Cellar/poetry/1.2.0_1/libexec/lib/python3.10/site-packages/virtualenv/seed/wheels/embed/pip-22.2.2-py3-none-any.whl/pip', 'install', '--disable-pip-version-check', '--prefix', '/Users/sergei/Library/Caches/pypoetry/virtualenvs/itunes-tag-sync-_c69w8Vl-py3.10', '--no-deps', '/Users/sergei/Library/Caches/pypoetry/artifacts/e1/09/c0/6a6df3ef412eb19fcda1b353ea54e3b48f9c518348fadd0967a962cbb6/pyparsing-3.0.9-py3-none-any.whl'] errored with the following return code 1, and output:
  ERROR: Can not combine '--user' and '--prefix' as they imply different installation locations

So it looks like Poetry is picking user option from the config and it conflicts with the option passed on command line.

Expected behaviour

Poetry ignores user config or at least potentially conflicting parts of it (e.g. user option).

Workaround

Use env variable to override user during Poetry run.

PIP_USER=0 poetry install
@sergei-dyshel sergei-dyshel added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Sep 15, 2022
@dimbleby
Copy link
Contributor

duplicate #1214

@neersighted neersighted added status/duplicate Duplicate issues and removed kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Sep 15, 2022
@neersighted neersighted closed this as not planned Won't fix, can't repro, duplicate, stale Sep 15, 2022
@sergei-dyshel
Copy link
Author

@dimbleby
I think you misunderstood the issue here and there's not duplicate here.

#1214 is talking about making Poetry into a global (or rather user-specific) package manager that installs packages to user directory.

This issue is talking about a BUG that poetry fails to install because of conflicting user configuration. Please correct me if I'm wrong.

@neersighted
Copy link
Member

Not really -- ultimately the request is to interoperate with pip --user or similar. Pip is an implementation detail of Poetry and anything you do to try and perturb Poetry's usage of pip may cause breakage (arguable we should be using pip --isolated) -- but a request for Poetry to respect pip's user mode is a duplicate of #1214.

@dimbleby
Copy link
Contributor

dimbleby commented Sep 15, 2022

fwiw I agree after all that this is not quite the same as #1214.

This one is sort of saying that there was a loophole all along that the #1214-wanters could have used, and asking for that loophole to be closed.

If poetry ever reaches the point where it doesn't shell out to pip at all then this all becomes moot.

Meanwhile, as you say, it probably ought to go --isolated when it does call pip, and it seems legit to have an issue tracking that.

@neersighted
Copy link
Member

Ah, after re-reading the original issue I see the distinction now -- this is a user's configuration of a different/external tool breaking Poetry.

@neersighted neersighted reopened this Sep 15, 2022
@neersighted neersighted added kind/bug Something isn't working as expected area/installer Related to the dependency installer version/1.2.0 and removed status/duplicate Duplicate issues labels Sep 15, 2022
@dimbleby
Copy link
Contributor

dimbleby commented Sep 15, 2022

--isolated should be a trivial addition to

args = ["install", "--disable-pip-version-check", "--prefix", str(environment.path)]
if anyone cares to make an MR

@neersighted
Copy link
Member

Already baking locally 😄

@sergei-dyshel
Copy link
Author

Thanks for understanding and quick patching ;)

Just one nitpick about avoid bad local config - there's nothing wrong or bad if user configures pip to install packages to user directory when he does pip install ... in terminal. On the other side, Poetry uses pip as internal implementation detail, in a way that is unrelated to the former flow. So something like to avoid conflict with user config would be more appropriate.

@neersighted
Copy link
Member

What I really mean is 'bad' from Poetry's perspective -- fair enough 😅

Copy link

github-actions bot commented Mar 1, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/installer Related to the dependency installer kind/bug Something isn't working as expected version/1.2.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants