I am using pyenv to select python 3.10.9:
pyenv global 3.10.9
python --version
Python 3.10.9
Poetry configuration file shows that Poetry should use the current python version:
(base) bob@Roberts-Mac-mini shims % poetry config --list (amended)
virtualenvs.create = true
virtualenvs.in-project = true
virtualenvs.prefer-active-python = true
but when I create a new poetry project:
poetry new --src newproject
in the generated pyproject.toml the python version is 3.11, which is the version that was active when I installed poetry itself (file amended):
(base) bob@Roberts-Mac-mini newproject % cat pyproject.toml
[tool.poetry]
name = "newproject"
version = "0.1.0"
description = ""
authors = ["XXXX YYYYYY <ZZZZZZZZZZ@gmail.com>"]
readme = "README.md"
packages = [{include = "newproject", from = "src"}]
[tool.poetry.dependencies]
python = "^3.11"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
I see there's an experimental poetry setting: https://python-poetry.org/docs/configuration/#virtualenvsprefer-active-python-experimental
Are there hidden problems using it?
The other solution I can think of is editing the pyproject.toml file, change python to 3.10 and then use "poetry env use 3.10" to create the venv with 3.10. Is this ok?
Are there other solutions to force the new environment to 3.10.9?