question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
neersightedcommented, Nov 5, 2022

In your case, it was because Ubuntu 22.04 ships with a different Python version from Ubuntu 20.04, and the symlink to the interpreter was busted. Beware of #6371 on Ubuntu 22.04 (you may need a deadsnakes or pyenv Python because of this Ubuntu bug).

0reactions
vfaziocommented, Nov 13, 2022

I’m hoping this is resolved with virtualenv 20.16.7 which was just cut and should be pulled into new installs, including 1.1.15. Upstream python also accepted a fix into mainline and backported it to 3.11 that will try to fallback to a versioned binary if an unversioned one is referenced but not available in the path pointed to by home in pyvenv.cfg

Read more comments on GitHub >

github_iconTop Results From Across the Web

Running poetry fails with /usr/bin/env: 'python': No such file or ...
poetry is dependent on whatever python is and doesn't attempt to use a specific version of python ... Install the following package instead...
Read more >
prompt keeps popping up asking me… - Apple Developer
Python is installed (Python 3.10.5), I have previously installed Xcode command line developer tools, so I'm not sure why I'm stuck in this...
Read more >
History | Poetry - Python dependency management and ...
Fix an issue where poetry install fails because of missing hashes for url dependencies (#6389). Fix an issue where Poetry was not able...
Read more >
Docker image template for Python applications
You can then debug the problem in-place, e.g. try running the custom entrypoint script directly, install new packages with pip (so long as...
Read more >
Install, Update, and Uninstall the AWS CLI version 1 on Linux
You can install the AWS Command Line Interface (AWS CLI) version 1 and its dependencies on most Linux distributions by using the pip...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found