python-poetry / python-poetry/poetry

`poetry.exe` in `.venv\Scripts` Conflicts with Global Install

Open
#8,307 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/plugin-api area/windows kind/bug status/triage
Dominant language
Python
Stars
34.3k
Forks
2.5k
Avg merge
2d 19h
Merged PRs (30d)
30

Description

  • Poetry version: 1.5.1
  • Python version: 3.8.10
  • OS version and name: Windows 10 22H2
  • pyproject.toml: N/A
  • 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

When creating a plugin, some poetry internals are needed:

# Generic plugin
from poetry.plugins.plugin import Plugin
from poetry.poetry import Poetry

# Application plugin
from poetry.plugins.application_plugin import ApplicationPlugin

My plugin project has a local virtual environment in .venv/. When adding poetry as a dependency:

poetry add poetry

the script poetry.exe (on Windows) is added to .venv\Scripts, which conflicts with the default binary (using pipx, this is %USERPROFILE%\.local\bin\poetry.exe).

e.g. When using another plugin for development, say poetry-plugin-sort,

pipx inject poetry poetry-plugin-sort

installs to the plugin to the default binary so that the plugin cannot be used in the virtual environment. Running poetry sort results in

The command "sort" does not exist.

Deleting the binary from .venv\Scripts temporarily solves the problem, but the binary is re-added to Scripts when poetry update updates poetry to a new version.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the Windows conflict by adding Poetry to a plugin project's .venv, then compare the .venv\Scripts\poetry.exe and pipx-installed Poetry paths. Start by tracing how dependency installation creates Windows scripts, and verify that poetry sort continues to resolve the intended global plugin after updates without manual deletion.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.