Option to force Poetry to create a virtual environment, even if a virtual env is active
See original GitHub issueI am using Poetry from within a conda
environment; with Poetry being installed by conda (poetry
is present in the environment.yaml
file). This might not be ideal but for a specific setup this seems to work well.
When running poetry install
, a venv
is not created because Poetry detect that a virtual environment (the Conda one) is already active.
I believe that we should be able to force Poetry to create a virtual environment anyway: the Conda environment is more “physical” than virtual in this case, as it replaces the system Python.
The same issue occurs when doing poetry shell
from within the Conda environment, after creating the virtual environment with the following workaround: I deactivate the Conda environment, use the full path to Poetry (in the bin
directory of the Conda environment) and do poetry install
.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:25
- Comments:12 (1 by maintainers)
+1 for the
conda
case, it’s pretty problematic in our remote environment, wherepython
interpreter is provided byconda
andpoetry install
doesn’t create project-specific venvs…One other feature that would be really nice is if
poetry shell
could activate whatever environment is needed, including callingconda activate
. I am not sure how internally this works, but the following workflow would be very useful:After doing this, it would be very nice if this or something similar could store information about the choice of environment in
poetry.toml
or something so that runningpoetry shell
from within the project first activates themy_conda_env
(untilpoetry env use
or similar is called in the future).