IssueRaiser

Option to force Poetry to create a virtual environment, even if a virtual env is active

I 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`.

Posted by chernals on May 10, 2021, 2:16 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.3,000 issues0 comments

onboarding (Other)

Option to force Poetry to create a virtual environment, even if a virtual env is active

chernalsMay 10, 2021, 2:16 PM

I 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`.

Comments (0)

No comments yet. Start the discussion.

Comment on this issue