Skip to content

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

@sergei-dyshel

Description

@sergei-dyshel

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/installerRelated to the dependency installerkind/bugSomething isn't working as expectedversion/1.2.0

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions