[nmglug] yt-dlp updating working on one debian, but not another
Akkana Peck
akkana at shallowsky.com
Tue Sep 5 08:34:14 PDT 2023
LeRoy Diener writes:
> Success, but also confusion.
[ ...
> Prior to asking how to install with pip, I searched on my own for how
> to do that. I got results
> like https://pip.pypa.io/en/stable/cli/pip_install/ which were
> confusing to me. It did not make sense to me to begin an install
> command with "python." So, I asked the generic question.
pip is Python's installation program, but it is itself written in Python. Some Pythonistas think all Python programs should be run with python -m programname, so in this case, python -m pip. I'm not sure why they advocate all that extra typing; maybe on some platforms (Windows?), installing pip doesn't include an executable called pip so people have to type the extra python -m. At any rate, on Linux there's no need (as you discovered).
Searching for pip advice, you'll also find other complications, like the debate about running in a virtualenv vs. running with --user vs. running under sudo. For a long time pip didn't have the mode where you can just run it as a regular user (like you ultimately did), so anybody installing with pip had to choose between these three imperfect options.
So don't feel bad about being confused by pip installs. It's better now, but used to be super confusing.
> What should I know about the window for KDE Wallet Service?
> 4 A warning showed keyring is skipped.
> What should I know about the keyring being skipped?
I see this sometimes with gtk/gnome programs. Some programs assume you're running a full gnome environment, and if you're missing parts of it (like not running whatever keyring service gnome expects) you'll get warnings spewed to standard output.
> 5 A warning showed installed in '/home/ll/.local/bin' which is not on
> PATH
> I'm familiar with the concept of path from my experience with DOS
> years ago. I have not done anything yet with path in Linux. Are there
> any recommendations for me for path? Is not good to get started? Any
> approach best?
That's something you do need to know.
PATH is the environment variable that tells the system where to look when you type a command. For instance, if you type "cat /etc/password", the system has to figure out what you mean by "cat" -- what program to run. So it looks in your $PATH environment variable, and then looks for a file named "cat" in each of the directories specified there, in order (so the first one wins).
You can see your PATH by typing: echo $PATH
It might look something like:
/usr/local/bin:/usr/bin:/bin
Colon : is the path separator, so with this path, if you type yt-dlp, it will look first for a file called /usr/local/bin/yt-dlp. Not finding that, it will look for a file /usr/bin/yt-dlp. And so on. It will run the first one it finds, and won't look any farther.
Since you now know that pip installs things to /home/ ll/.local/bin, you want to have that in your PATH, so you'll be able to type yt-dlp rather than /home/ ll/.local/bin/yt-dlp. The most common way to do this is to edit your shell initialization file. If you're using bash, you could put it in one of the files bash runs once, at login time:
export PATH=$HOME/.local/bin:$PATH
That tells bash to take whatever its default PATH is, stick $HOME/.local/bin at the beginning, and export it so it wil be visible to other programs your login shell might run. Putting it at the beginning means when you run yt-dlp, it will find the one in .local/bin first, before something that's in /usr/bin or wherever.
Or you could set it explicitly in .bashrc, e.g.
export PATH=$HOME/.local/bin:/usr/local/bin:/usr/bin:/bin
but then you have to make sure the path includes everything you'll ever want to run.
> 6 I tried to run yt-dlp from the directory where I want to download a
> video into. That failed.
That's why you need it in your PATH.
...Akkana
More information about the nmglug
mailing list