Skip to content

Poetry fails to use the currently activated environnement #8631

@laclouis5

Description

@laclouis5
  • Poetry version: 1.7.0

  • Python version: 3.11

  • OS version and name: Ubuntu 22.04.3 LTS

  • pyproject.toml: Empty TOML as created by poetry new <project>

  • I am on the latest stable Poetry version, installed using a recommended method.

  • I have searched the issues of this repo and believe that this is not a duplicate.

  • I have consulted the FAQ and blog for any relevant entries or release notes.

  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option) and have included the output below.

Issue

In some circonstances Poetry fails to use the activated virtual environnement (for instance a Conda environnement). In my experiments, this seems to occur when there is an hyphen (-) in the name of the folder of the project (for instance poetry-project).

To Reproduce

poetry new poetry-project
cd poetry-project

conda create -n poetry-project python=3.11 -y
conda activate poetry-project

poetry env info

This returns:

Virtualenv
Python:         3.10.11
Implementation: CPython
Path:           NA
Executable:     NA

This works correctly if I change the folder name to use an underscore(_) instead of the hyphen (-), for instance poetry_project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/venvRelated to virtualenv managementkind/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions