Pip should not be run with sudo like described in the readme
See original GitHub issueChecklist
- I’m reporting a broken site support issue
- I’ve verified that I’m running youtube-dl version 2021.12.17
- I’ve checked that all provided URLs are alive and playable in a browser
- I’ve checked that all URLs and arguments with special characters are properly quoted or escaped
- I’ve searched the bugtracker for similar bug reports including closed ones
- I’ve read bugs section in FAQ
Verbose log
Description
In the readme under “Installation” it says:
You can also use pip:
sudo -H pip install --upgrade youtube-dl
In the download instructions it says:
You can also use pip:
sudo pip install --upgrade youtube_dl
However, pip shouldn’t be run with sudo, including due to security reasons. See also: https://github.com/sahib/rmlint/issues/543
The security reasons for not running pip with sudo are described here.
It’s also not necessary for installing youtube-dl.
Hence, the readme and the website should be changed to have sudo removed from there.
Moreover, as youtube-dl is in the Debian repositories, the download instructions should add info about installation from there, like "Users of Debian can also install it from the repositories, e.g. with sudo apt-get install youtube-dl.
Issue Analytics
- State:
- Created 2 years ago
- Comments:17 (4 by maintainers)
Top Results From Across the Web
README should add 'sudo apt-get install python-pip' and ...
In general, you should never run pip as root. Instead, use virtualenv to create a "virtual [python] environment" into which you can install ......
Read more >sudo and pip not on the same path
It seems like pip is not installed at system level. You can install pip at system level by running sudo apt-get install python-pip...
Read more >Is `sudo pip install` still a broken practice?
Apt installs packages from Ubuntu's repositories, whereas pip installs user-uploaded packages from PyPi which could be malicious. Share.
Read more >dont-sudo-pip
Imagine running sudo pip install uincode and installing a malicious package uincode , instead of sudo pip install unicode like you wanted.
Read more >Sudoers Manual | Sudo
It must be specified as a numeric group ID (not a group name). ... If sudo is run by root and the SUDO_USER...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

So I meant that it would waste developer’s time.
I don’t think installation section needs to provide every piece of information to any kind of users. Be it as simple and common to platforms. If anything about PATH to write, “adjust PATH environment variable as needed” or so should be enough.
Of course I’m not in a position to update the README, this is just my personal opinion.
I don’t see why installing something system-wide should be the recommended default if there is no distro package available, official or otherwise.
pip install --user youtube-dlworks just fine for a single user as long as~/.local/binis on their PATH, and doesn’t pollute the system with root-owned files not tracked by the package manager or risk giving root access to a malicious actor. Running pip as root is also a bad habit to get users into, even if youtube-dl is safe.