Skip to content

Add PowerShell command in "install packages in venv" guide - #1542

Open
dharmatech wants to merge 3 commits into
pypa:mainfrom
dharmatech:patch-1
Open

dharmatech wants to merge 3 commits into
pypa:mainfrom
dharmatech:patch-1

Conversation

@dharmatech

@dharmatech dharmatech commented May 7, 2024 •

Copy link
Copy Markdown
Contributor

Use Get-Command if on PowerShell

where in PowerShell is an alias for Where-Object.

If you use where in Powershell, no output is returned. Use Get-Command instead:

image


📚 Documentation preview 📚: https://python-packaging-user-guide--1542.org.readthedocs.build/en/1542/

@chrysle

chrysle commented May 8, 2024

Copy link
Copy Markdown
Contributor

Thanks! Let's put the command into another code block with PowerShell code lexer?

@webknjaz webknjaz added type: enhancement A self-contained enhancement or new feature state: awaiting response labels Aug 11, 2025
@webknjaz

Copy link
Copy Markdown
Member

Hey @dharmatech, would you address the review comment?

@rgommers rgommers left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original didn't quite work, but after the review suggestions it also doesn't work, since the tabs no longer match and activating is also a different command under PowerShell:

Image

I pushed a second commit that fixes that. However, this doesn't look all that good. I question whether PowerShell should get a special tab or mention at all here. There are no other tabs or examples in the whole Packaging Guide that use PowerShell. So I'm kind of inclined to close this rather than merge it. Any thoughts on that @webknjaz, @merwok or other maintainers?

@merwok

merwok commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

Oh, I expected the guide to generally show the native windows commands!

If this is not the case, then don’t add one just for this PR, but I do wonder if windows users are well served by unix-centric docs then.

@rgommers rgommers changed the title Update installing-using-pip-and-virtual-environments.rst Add PowerShell command in "install packages in venv" guide Nov 11, 2026
@rgommers

Copy link
Copy Markdown
Contributor

If this is not the case, then don’t add one just for this PR, but I do wonder if windows users are well served by unix-centric docs then.

I think it's the case that the way Python and installers work is generally less "native" on Windows; CLI tools are just foreign and badly served there. There's no way we can fix that. That there are multiple shells with different commands makes that worse. It will only be fixed if there's a completely integrated tool/launcher I think. PowerShell is not something I'd call "more native" than other shells, it's just generally for a niche sysadmin audience, not for the average Python user.

@brettcannon maybe you want to make this decision?

@merwok

merwok commented Nov 11, 2026

Copy link
Copy Markdown
Contributor

I checked the Python Devguide and the windows tabs there don’t use powershell commands actually, but for example .\python something rather than $ ./python something.

I think I was remembering some commands in the pip documentation (or another) that used native powershell commands instead of curl & co.

So please let’s fix the activate command, and if needed which/where/etc. native shell (i.e. command prompt or whatever is opened by windows devs) commands, but let’s not introduce powershell then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state: awaiting response type: enhancement A self-contained enhancement or new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants