One way to solve error: "externally-managed-environment" is to create a virtual environment folder in your root path. By creating and using a virtual environment, you bypass the system Python entirely, allowing you to install and manage packages freely without impacting the system-wide Python installation
python3 -m venv ~/py_envs
source ~/py_envs/bin/activate
python3 -m pip install yt-dlp
yt-dlp is a better option with more functionalities (it's a fork from youtube-dl).
Everytime that you need to use yt-dlp you have to execute the first two commands above.
-----------------------
The following produce an error. It's better to use a virtual environment as shown here above:
sudo apt install python3-pip
sudo pip3 install --upgrade youtube-dl
-----------
The following is deprecated:
sudo apt install python-pip
sudo pip install youtube-dl
If you want to upgrade youtube-dl
sudo pip install --upgrade youtube-dl
or, if necessary
sudo pip install youtube-dl
If you want to upgrade youtube-dl
sudo pip install --upgrade youtube-dl
or, if necessary
sudo pip install --upgrade pip
The following method of installation is deprecated:
sudo apt-get install python-setuptools
sudo easy_install pip