Poetry + Pyenv, create new project #7059
-
|
Consider the following situation: I'm using I thought that if I ran $ pyenv versions
* system
3.11.0 $ pyenv shell 3.11.0Then using poetry to start a new project, like $ poetry new myprojectwould create a new folder with all the relevant stuff inside, and file [tool.poetry]
name = "myproject"
version = "0.1.0"
description = ""
authors = ["Me <[email protected]>"]
readme = "README.md"
[tool.poetry.dependencies]
python = "^3.11"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"notice the python version. However this is not the case as Is this the intended behavior? Shouldn't I'm aware of other issues with similar questions:
|
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
|
Poetry has always used the Python interpreter that is currently executing its Python code as the default. When we migrated to the new install layout (with the new install.python-poetry.org installer) to deprecate our idiosyncratic and difficult to maintain custom packaging (in favor of wheels) and support plugins/Keyring providers, we also introduced a new setting, It's experimental and there are some known edge cases @finswimmer is working on solving, but it should largely do what you want (find |
Beta Was this translation helpful? Give feedback.
-
|
I do use Poetry and pyenv, what I like to do to guarantee that poetry uses the python version I selected for that project is:
This doesn't solve the problem with |
Beta Was this translation helpful? Give feedback.
Poetry has always used the Python interpreter that is currently executing its Python code as the default. When we migrated to the new install layout (with the new install.python-poetry.org installer) to deprecate our idiosyncratic and difficult to maintain custom packaging (in favor of wheels) and support plugins/Keyring providers, we also introduced a new setting,
virtualenvs.prefer-active-python.It's experimental and there are some known edge cases @finswimmer is working on solving, but it should largely do what you want (find
pythonin the PATH instead of usingsys.executable).