[nmglug] Success Re: yt-dlp updating working on one debian, but not another
LeRoy Diener
leroy at choosetherightside.com
Wed Sep 6 13:45:28 PDT 2023
Thanks, Akkana.
There are many things that you wrote which are helpful.
I like the intro for pip and what pip is and other bits about pip.
It's good to know that I can safely ignore the warning about the KDE
wallet and the keyring and also about what that is.
I appreciate most the description about PATH and how to get started
with it. I found more info
at https://www.howtogeek.com/658904/how-to-add-a-directory-to-your-path-in-linux/
which gives an intro in a bit more depth.
Here are my results:
This is from len4, where yt-dlp was already working
ll at len4:~$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
ll at len4:~$
ll at len4:~$ type -a yt-dlp
yt-dlp is /usr/local/bin/yt-dlp
This is from leno
ll at leno:~$ echo $PATH
/home/ll/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
ll at leno:~$
ll at leno:~$ type -a yt-dlp
yt-dlp is /home/ll/.local/bin/yt-dlp
...
ll at leno:~/A-Video-260/eMata$ yt-dlp
https://www.youtube.com/watch?v=O8NqgtL5a4I
bash: /usr/bin/yt-dlp: No such file or directory
ll at leno:~/A-Video-260/eMata$ ~/.local/bin/yt-dlp
https://www.youtube.com/watch?v=O8NqgtL5a4I
[youtube] Extracting URL: https://www.youtube.com/watch?v=O8NqgtL5a4I
... has already been downloaded
ll at leno:~/A-Video-260/eMata$ echo $PATH
/home/ll/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
ll at leno:~/A-Video-260/eMata$ echo $HOME
/home/ll
ll at leno:~/A-Video-260/eMata$ export PATH=$HOME/.local/bin:$PATH
ll at leno:~/A-Video-260/eMata$ echo $PATH
/home/ll/.local/bin:/home/ll/bin:/usr/local/bin:/usr/bin:/bin:/usr/loca
l/games:/usr/games
ll at leno:~/A-Video-260/eMata$ yt-dlp
https://www.youtube.com/watch?v=O8NqgtL5a4I
... has already been downloaded
ll at leno:~/A-Video-260/eMata$
Notes:
1 The $PATH on len4 and the $PATH on leno were the same, except leno
had an extra in front, i.e. /home/ll/bin Now, leno has two extras in
front.
2 yt-dlp is in usr/local/bin/ on len4 whereas yt-dlp is
in /home/ll/.local/bin/ on leno
I'm guessing that yt-dlp on len4 was not installed using pip??
3 In the last several lines, I tested trying to run yt-dlp, then added
to the path, confirmed the path change, then confirmed that yt-dlp is
working with the new path.
I'm feeling grateful.
LeRoy
--
There is something glorious birthing within all of us.
I am the Love of God, no matter what.BSA
LeRoy Diener
213-LEROYIZ
213-537-6949
https://leroydiener.com
On Tue, 2023-09-05 at 09:34 -0600, Akkana Peck wrote:
> 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
> _______________________________________________
> nmglug mailing list
> nmglug at lists.nmglug.org
> http://lists.nmglug.org/listinfo.cgi/nmglug-nmglug.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nmglug.org/pipermail/nmglug-nmglug.org/attachments/20230906/f09259d0/attachment.htm>
More information about the nmglug
mailing list