python-poetry / python-poetry/install.python-poetry.org

[Doc] Add PowerShell snippet in the installation instructions (web & scripts) to allow Windows users to modify `%PATH%` easier

Open
#66 3 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
255
Forks
65
Avg merge
2h 48m
Merged PRs (30d)
1

Description

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

Issue

https://python-poetry.org/docs/master/#installing-with-the-official-installer

Add Poetry to your PATH

The installer creates a poetry wrapper in a well-known, platform-specific directory:

  • $HOME/.local/bin on Unix.
  • %APPDATA%\Python\Scripts on Windows.

If this directory is not present in your $PATH, you can add it in order to invoke Poetry as poetry.

Alternatively, the full path to the poetry binary can always be used:

  • $POETRY_HOME/bin/poetry if $POETRY_HOME is set.
  • ~/Library/Application Support/pypoetry/bin/poetry on MacOS.
  • ~/.local/share/pypoetry/bin/poetry on Linux/Unix.
  • %APPDATA%\pypoetry\Scripts\poetry on Windows.

The following snippet is helpful and should be appended in the document for Windows users:

if (-not (Get-Command poetry -ErrorAction Ignore)) { [Environment]::SetEnvironmentVariable("Path", [Environment]::GetEnvironmentVariable("Path", "User") + ";$env:APPDATA\Python\Scripts", "User") }

or (for PowerShell 6+)

if (-not (Get-Command poetry -ErrorAction Ignore)) { echo 'if (-not (Get-Command poetry -ErrorAction Ignore)) { $env:Path += ";$env:APPDATA\Python\Scripts" }' | Out-File -Append $PROFILE }

P.S. The script provided by https://install.python-poetry.org also needs this fix.

Contributor guide

No contributing guide indexed for this repository

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

Start with the installation instructions at the linked official-installer documentation section and inspect the installer script provided by install.python-poetry.org. Compare the Windows PATH guidance for standard PowerShell and PowerShell 6+, then verify that both the documentation and script address the reported Windows setup case.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell, python
Domain
cli, documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.