python-poetry / python-poetry/poetry

Poetry tries using Python2 (usr/local/bin/python) instead of the provided distribution during install

Open
#6,940 10 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/bug status/triage
Dominant language
Python
Stars
34.3k
Forks
2.5k
Avg merge
2d 19h
Merged PRs (30d)
30

Description

Issue

I don't have any reproducing steps, but I used to have Poetry 1.1-something, just earlier I uninstalled it to install 1.2.2.
I made sure to use python3.11 - after the curl command. But for whatever reason it still tries to use Python 2?

Whenever I try to run poetry update or poetry install it just fails with failed to query /usr/local/bin/python with code 2 err: 'No such file or directory' suddenly.

I tried searching for any existing issues, but searching for "No such file or directory" or "Wrong Python" or "Python 2" gives a ton of results, so apologies if this is a duplicate.

Edit: I did find this https://github.com/python-poetry/poetry/issues/6841 & #6371, but I tried what both the OP and the people replying suggested, and still get the same result.

Much later edit:
Doing poetry env use python3.10 then poetry install seems to work, so is this some weird Python 3.11 compatbility issue with Debian or something? (thinking about #6371) I did build Python 3.11 myself, don't remember if I did that with Python 3.10 as well.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked pyproject.toml and debug_logs_py output, then compare the behavior of poetry update and poetry install on Debian 11 under WSL with Python 3.11. Check the related issues #6841 and #6371 and use poetry env use python3.10 as the reported comparison; the issue is resolved when the provided Python distribution is selected without the missing /usr/local/bin/python error.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.