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 self update --preview installs to system python #4728

Closed
3 tasks done
mindlace opened this issue Nov 10, 2021 · 4 comments
Closed
3 tasks done

Poetry self update --preview installs to system python #4728

mindlace opened this issue Nov 10, 2021 · 4 comments
Labels
kind/bug Something isn't working as expected

Comments

@mindlace
Copy link

mindlace commented Nov 10, 2021

  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name: OSX Big Sur 11.6
  • Poetry version: 1.1.11 & 1.2.0a2
  • Link of a Gist with the contents of your pyproject.toml file: No pyproject required

Issue

When updating poetry, it installs to the currently active python rather than poetry's "self contained" venv, leaving the isolated poetry at the prior version.

Steps to reproduce:

  1. python -m pip list -> shows no poetry package
  2. curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py | python - -> installs 1.11.1
  3. python -m pip list -> unchanged
  4. poetry self upgrade --preview -> upgrades
  5. python -m pip list -> includes all deps for poetry 1.20.0a2

Full shell transcript here

Expected behavior:

Poetry updates itself inside its virtualenv, and does not install anything in the local/current python env

@mindlace mindlace added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Nov 10, 2021
@rowanseymour
Copy link

I think we're seeing the same problem with updating from 1.1.11 to 1.1.12. It's trying to update system python and blowing up for a lack of permissions.

:~$ which poetry
/home/foo/.local/bin/poetry
:~$ poetry self update
Updating Poetry to 1.1.12

Updating dependencies
Resolving dependencies... (0.7s)

Package operations: 1 install, 19 updates, 0 removals

  - Updating zipp (3.1.0 -> 3.6.0)
  - Updating certifi (2018.1.18 /usr/lib/python3/dist-packages -> 2021.10.8)

  EnvCommandError

  Command ['pip', 'uninstall', 'certifi', '-y'] errored with the following return code 2, and output:
  Found existing installation: certifi 2018.1.18
  Uninstalling certifi-2018.1.18:
  ERROR: Exception:
  Traceback (most recent call last):
    File "/usr/lib/python3.6/shutil.py", line 550, in move
      os.rename(src, real_dst)
  PermissionError: [Errno 13] Permission denied: '/usr/lib/python3/dist-packages/certifi' -> '/tmp/pip-uninstall-viqko_d0'

Maybe I'm misunderstanding how it works but I would expect it to only make changes in /home/foo/.local/lib/python3.6/ and not be touching /usr/lib/python3/

@cpmsmith
Copy link

cpmsmith commented Mar 23, 2022

I'm seeing this as well—somehow, I've ended up with a poetry file in /opt/homebrew/bin (macOS, arm64) and try as I might, I can't get the uninstaller script to see it. The timestamp on the file is just after I ran poetry self update --preview from 1.1.13 to 1.2.0b1 [edit: as finswimmer's comment implies, I was in fact upgrading from 1.1.12, not 1.1.13, hence the problem]

@finswimmer
Copy link
Member

Hello,

this is fixed since poetry 1.1.13 by #5048.

fin swimmer

@mkniewallner mkniewallner removed the status/triage This issue needs to be triaged label Jun 11, 2022
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
kind/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

5 participants