1

I have the following youtube-dl version

  youtube-dl --version
    2020.03.24

I would like to update it with the following command

pip3 install --upgrade youtube-dl
Requirement already up-to-date: youtube-dl in ./.local/lib/python3.8/site-packages (2020.11.12)

It seems that I already have it updated to 2020.11.12 version, but when I check the version, it does not update it.

$ youtube-dl --version
2020.03.24

The question is: is my youtube-dl running on Python2? how can I change it to run with Python3? how can I update my youtube-dl to the latest version?

Madeyra
  • 289
  • 4
  • 17

2 Answers2

1

I think it's because youtube-dl is being accessed from somewhere else in the path.

Check the version this way:

python3 -m youtube-dl --version

If it shows the right version you're looking for, it means that somewhere else in your path there is another youtube-dl which your using, you can use the updated version of youtube-dl like this: python3 -m youtube-dl or you can delete the other youtube-dl from your path.

  • /usr/bin/python3: No module named youtube-dl is the output of the command you recommended me :-( – Madeyra Nov 12 '20 at 16:25
1

The apt version of youtube-dl has the version number 2020.03.24 in Ubuntu 20.04.

To uninstall it and install the latest version of youtube-dl, enter the following commands one by one.

sudo apt remove youtube-dl
pip3 install --user youtube-dl

The pip version of youtube-dl resides in .local/bin/ in your home folder.

To add it to your path, add the following lines to the hidden .profile file in your home folder (create it, if it already does not exist. Press ctrl + H to show hidden files). Restart your computer for the change to take effect.

if [ -d "$HOME/.local/bin" ] ; then
    PATH="$HOME/.local/bin:$PATH"
fi
Archisman Panigrahi
  • 28,338
  • 18
  • 105
  • 212
  • I did what you asked me. The first command uninstalls the existing youtube-dl. The second command outputs me the following: Requirement already satisfied: youtube-dl in ./.local/lib/python3.8/site-packages (2020.11.12). How can I tell Ubuntu where youtube-dl is? thanks. – Madeyra Nov 12 '20 at 16:36
  • @Madeyra I have edited my answer to add this information – Archisman Panigrahi Nov 13 '20 at 08:03