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

(🐞) Glitch when poetry tries to find a different version of python for the project #7090

Closed
KotlinIsland opened this issue Nov 24, 2022 · 5 comments
Labels
status/duplicate Duplicate issues

Comments

@KotlinIsland
Copy link
Contributor

  • Poetry version: 1.2.2
  • Python version: 3.11
  • OS version and name: Windows 10
  • pyproject.toml:
[tool.poetry]
name = "poetry-test"
version = "0.1.0"
description = ""
authors = [""]

[tool.poetry.dependencies]
python = "~3.10"
  • [🚀] 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

👉 poetry install
The currently activated Python version 3.11.0 is not supported by the project (~3.10).
Trying to find and use a compatible version.
Using python3.10 (3.10.8)
Creating virtualenv poetry-test-RGMhFuFN-py3.10 in C:\Users\AMONGUS\AppData\Local\pypoetry\Cache\virtualenvs

[WinError 2] The system cannot find the file specified: 'C:/Users/AMONGUS/projects/poetry-test/python3.10'    
@KotlinIsland KotlinIsland added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Nov 24, 2022
@neersighted
Copy link
Member

This is well-known, though I can't find the original issue to duplicate right now. This is because Poetry currently naively tries to find Python version X.Y by executing pythonX.Y; this works on Unix as the convention there is to install a versioned Python executable (and symlink python/python3 to your preferred version), but fails on Windows.

We can use the py.exe wrapper, or pythonfinder, or similar; one of these options is needed to resolve this. Please let me know if you can find the duplicate, as this topic has already been discussed at length several times.

@KotlinIsland
Copy link
Contributor Author

KotlinIsland commented Nov 24, 2022

What's strange here though is that it correctly found the installed python 3.10.8. And strangely it tried to execute the python exe in the current directory

~\projects\poetry-test\python3.10

@KotlinIsland
Copy link
Contributor Author

related to #3520

@neersighted
Copy link
Member

Aha, this is a duplicate of #2117 -- there's no explicit env use here, but the code path is the same for env use or auto-selection of a compatible Python (once the version has been determined).

@neersighted neersighted closed this as not planned Won't fix, can't repro, duplicate, stale Nov 24, 2022
@neersighted neersighted added status/duplicate Duplicate issues and removed kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Nov 24, 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
status/duplicate Duplicate issues
Projects
None yet
Development

No branches or pull requests

2 participants