Poetry doesn't use custom pyenv environment #9455
Labels
area/init
Related to 'poetry init'/project creation
area/python
Related to detection of Python installations
kind/bug
Something isn't working as expected
status/triage
This issue needs to be triaged
Description
I prefer to keep my venvs controlled by pyenv and located in the project directory.
This is how I create a new virtual environment ("poetry-playground" is the name of the current directory):
poetry-playground PYENV_VERSION=3.12.2 python -m venv venv poetry-playground source venv/bin/activate
At this point, venv (located in "venv" folder) is created and activated. Next, I init a new poetry project inside venv:
Next, I want to add
requests
, but somehow it installs not to the current venv, but somewhere else (presumably, to system interpreter):And of course, no
requests
is installed to the current venv.The question is: is it possible to use poetry in this kind of environment? I've been using
pip
for years and trying to switch to poetry right now, so maybe I'm missing something. As you can see in "poetry configuration" section below, I already have:If I set
virtualenvs.create
totrue
, then myvenv
is ignored and poetry creates a new venv in./.venv
directory. This is not something I want. Again, I want to create my own venv using pyenv (with any Python version I like) and then control it with poetry.Thanks in advance!
Workarounds
None that I'm satisfied with
Poetry Installation Method
other
Operating System
MacOS 14.5 Sonoma
Poetry Version
Poetry (version 1.8.3)
Poetry Configuration
Python Sysconfig
No response
Example pyproject.toml
No response
Poetry Runtime Logs
The text was updated successfully, but these errors were encountered: