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 1.2.1 install fails to install packages with pip dependency #6567

Closed
3 of 4 tasks
SfinxCZ opened this issue Sep 19, 2022 · 11 comments · Fixed by #6582
Closed
3 of 4 tasks

Poetry 1.2.1 install fails to install packages with pip dependency #6567

SfinxCZ opened this issue Sep 19, 2022 · 11 comments · Fixed by #6582
Labels
area/installer Related to the dependency installer kind/bug Something isn't working as expected status/confirmed Issue is reproduced and confirmed version/1.2.1

Comments

@SfinxCZ
Copy link

SfinxCZ commented Sep 19, 2022

  • Poetry version: 1.2.1

  • Python version: 3.8.12

  • OS version and name: macOS 12.6 but same problem observed in docker built with python:3.8 as base image

  • pyproject.toml: https://gist.github.com/SfinxCZ/a8a80b14cc19c6631942adb2fb6ca3ff

  • I am on the latest stable Poetry version, installed using a recommended method.

  • I have searched the issues of this repo and believe that this is not a duplicate.

  • I have consulted the FAQ and blog for any relevant entries or release notes.

  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Issue

After upgrading to poetry 1.2.1 I have encountered an issue where poetry fails to install project linked above (pyproject.toml). From what I've observed, the problem seems to occur, when the project depends on a library that has pip as its dependency (chalice in this case). Then, during the installation poetry tries to upgrade pip to version listed in the poetry.lock file. However, other libraries that are being installed at the same moment require pip to be installed and installation fails - see the log here install.log.

Reproducing this error is tricky as it seems to be a raise condition that depends on the parallelism used in the install step.

Downgrading to poetry 1.2.0 seems to fix the problem.

@SfinxCZ SfinxCZ added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Sep 19, 2022
@neersighted neersighted added status/confirmed Issue is reproduced and confirmed version/1.2.1 area/installer Related to the dependency installer and removed status/triage This issue needs to be triaged labels Sep 19, 2022
@neersighted
Copy link
Member

cc @radoering @dimbleby

This is related to walking back the use of the virtualenv seed pip -- I think we may need to add a special case for pip and upgrade it first (with no parallelism) when we are manipulating it to avoid this.

@dimbleby
Copy link
Contributor

If that's right then:

  • it has long been broken (albeit briefly not broken at 1.2.0): poetry 1.1.x did not prefer the embedded pip
  • it's easy to work around (upgrade pip before running poetry)
  • a better fix is getting near (Faster build and installation of packages #6205 so that poetry doesn't rely on pip here at all)

suggest that if someone can think of a cheap fix then great, but in that context I submit that it's not worth a lot of effort

@neersighted
Copy link
Member

neersighted commented Sep 19, 2022

Poetry 1.1.x will not actually manipulate pip at all -- it is effectively blind to pip (try adding pip to a pyproject.toml, then check the lock file using 1.1.15).

This is a new issue, but arguably not a regression as treating pip as just another dependency is a new capability of Poetry 1.2.

Edit: upgrading pip before running Poetry is not really a solution as Poetry may want to change the version (or reinstall if the direct origin URL is different) based on the lock file -- Poetry would need to upgrade pip first before running the concurrent installer on all other dependencies.

@dimbleby
Copy link
Contributor

re upgrading pip: indeed it would be necessary to update to whatever version was written in the lock file. In this case that is the latest but ack that in principle it might not be

@dimbleby
Copy link
Contributor

maybe that poetry 1.1 behaviour suggests the cheap and good-enough-for-now fix is to reinstate pip among the UNSAFE_PACKAGES

That's still broken in principle - what if the project requires a version of pip that's different than the version that's currently in the environment?

But depending on pip is pretty rare, then it's really quite unlikely that "some recent pip" is not good enough - it's probably a sticking plaster that would hold for some time.

@neersighted
Copy link
Member

I'm not sure adding pip back to UNSAFE_PACKAGES is the best call here -- I intend to finish #6458 once the next pip version is released. It will solve this issue for every package but Poetry installed in editable mode installing itself (which to be fair, is very rare and specific, but annoying for us people working on Poetry) -- I'd like to try and solve this if it's not too much of a headache as the existing pip-based install path will remain in the codebase for some time.

@beeb

This comment was marked as off-topic.

@neersighted

This comment was marked as off-topic.

@beeb

This comment was marked as off-topic.

@neersighted

This comment was marked as off-topic.

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 status/confirmed Issue is reproduced and confirmed version/1.2.1
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants