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

After the installation of poetry via the new script install-poetry.py poetry ignores pyenv local python version #4199

Closed
skei0 opened this issue Jun 23, 2021 · 10 comments · Fixed by #4852
Labels
kind/feature Feature requests/implementations status/needs-consensus Consensus among maintainers required

Comments

@skei0
Copy link

skei0 commented Jun 23, 2021

  • [x ] I am on the latest Poetry version.

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

  • OS version and name: Kernel: 5.4.0-74-generic x86_64 bits: 64 compiler: gcc v: 9.3.0 Desktop: MATE 1.24.0
    wm: marco dm: LightDM Distro: Linux Mint 20.1 Ulyssa base: Ubuntu 20.04 focal

  • Poetry version: 1.1.6

Issue

After the installation of poetry via the new script install-poetry.py poetry ignores pyenv local python version. I don’t know why. I checked those issue 1, 2, 3 but nothing work for me. After uninstalling and installing via old script get-poetry.py all semis to work. Except of this bug mentioned hier.

@skei0 skei0 added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Jun 23, 2021
@finswimmer
Copy link
Member

@zyv
Copy link
Contributor

zyv commented Jun 24, 2021

Related to #4207?

@theirix
Copy link

theirix commented Aug 6, 2021

Seems like only poetry env use "/path/to/pyenv/python" works. Activating via standard pyenv ways like env var or .python-version does not work.

Reproduced with 1.1.7 and a new install-poetry.py installer. The effective version can be checked via poetry env info | grep '^Python'.

The unrelated but important thing - I think the documentation page must be updated to omit pyenv local instructions for a while. File an issue?

@techdragon
Copy link

techdragon commented Aug 19, 2021

Not working well with pyenv like previous versions did, feels more like the sort of thing that belongs in a a x.0.0 major release. This significantly affects how I have to manage my python environments in order to have poetry just recognise a version.

In previous behaviour I could have a 3.6,3.7,3.8,3.9 all installed via pyenv and poetry would automatically use the right one for the python version inside pyproject.toml, it was the best python environment management has ever been. While the new changes are I'm sure (from what I have read of the rationale, and my experience as a fellow python dev who has looked into this sort of thing) a significant improvement in maintainability... it is a degradation of functionality for the end users that needs promptly addressing. So, with that In mind, how can I help? Anyone got PRs for this that need testing or extra eyeballs on potential fixes?

edit: It's worth noting that this change of behaviour also has knock on impacts. If you install poetry in each pyenv python version, so that you can just use poetry in the currently activated pyenv python version, you end up "polluting" the base environment which will affect any use of the --system-site-packages option which while poetry doesn't use this by default, this does potentially impact the management of other virtualenvs.

@Kurt-von-Laven
Copy link

I encountered the same issue using asdf and the old get-poetry.py install script on Poetry 1.1. I don't know whether the workaround that helped me will help you if you used the new install-poetry.py installer.

@vikigenius
Copy link

This seems to be a complete breaking change, and the documentation and readme should reflect this.
Previously just poetry install would automatically determine the correct python version I set using pyenv.

But now, I have to do poetry env use and then a poetry install

And after the documentation reflects this, as @techdragon suggested this is a big degradation of functionality here, it would be good to have an issue tracking this, if not already there.

@Kurt-von-Laven
Copy link

@vikigenius, refer to #1888 (linked above), the 3 issues already linked to it, as well as #651 and #4187. I am not affiliated with Poetry, but @sdispater, the author, has mentioned this change was made to reduce Poetry's maintenance burden and improve security. To my knowledge, there is presently no intention of changing it back.

@istrupin
Copy link

poetry env use $(pyenv which python) seems to get me unblocked, but it would be nice for this to "just work", or at the very least, for it to be included in the docs, since they imply that local pyenv settings should get picked up.

@finswimmer
Copy link
Member

Everyone interested can try out #4852 and give feedback :)

@finswimmer finswimmer added kind/feature Feature requests/implementations status/needs-consensus Consensus among maintainers required and removed kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Dec 30, 2021
Copy link

github-actions bot commented Mar 2, 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 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/feature Feature requests/implementations status/needs-consensus Consensus among maintainers required
Projects
None yet
8 participants