-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Have the "Install Python" command from the walkthrough open and fill in the suggested command #19448
Comments
How to decide choose between what commands to run for linux:Approach 1: Identify whether it's a Fedora or Debian distribution
Approach 2: Check if dnf is available directly
cc/ @karthiknadig Approach 1.3 seems like a viable option. |
https://www.npmjs.com/package/which should take care of approach 2.2. I personally prefer approach 2 as it's feature detection instead of distro detection. It's also simple enough to implement ourselves. import * as fs from "node:fs";
import * as path from "node:path";
import * as process from "node:process";
// Static since it won't change for the life of this process.
const path = process.env.PATH?.split(":");
function binExists(name: string): boolean {
return path.some(dir => fs.existsSync(path.join(dir, name)));
} |
This leaves out CentOS 7, which uses yum, and also any other distribution that uses neither dnf nor apt. I think I'd rather have the editor admit that it doesn't know which command to use rather than for it to suggest I use apt. |
For distributions that uses neither dnf nor apt, it's probably simplest to point to the python.org install page in the walkthrough description. For purposes of this issue, I see a couple options:
Any suggestions? |
I would assume that Python is available in the package manager. Downloading from a website seems tedious in comparison. |
It is, but not sure if users would know the command to install python, pip etc. from it.
+1. Here I could also point out Regardless, most latest distros today come with some kind of Python installed, so we should not hit this case much. |
I'm unable to get my CentOS 7 and Debian 9 VMs to the state where there's absolutely no Python installed. |
Moved the executables out of the way and that worked. |
For instance, on macOS we currently suggest folks install via Homebrew using a command. We could update the walkthrough to have a permanent link to download Python that's in the text and then have the "Install Python" command open the terminal and send the command. We would probably want to have custom text for the button like "Install Python via Homebrew".
The text was updated successfully, but these errors were encountered: