Skip to content

Instantly share code, notes, and snippets.

@thocell
Last active April 10, 2020 16:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save thocell/4c867777419eb00a732dfb58f7e05f83 to your computer and use it in GitHub Desktop.
Save thocell/4c867777419eb00a732dfb58f7e05f83 to your computer and use it in GitHub Desktop.
Force youtube-dl to use python 3.6
Since python 2.x will be deprecated in 2020, it is better to use python 3.x for youtube-dl.
Plus, python 3.6 runs faster. But for ubuntu, normaly, youtube-dl just uses python 2.x.
Here is how to force youtube-dl to use python 3.6.
*1.Install python3.6 according to this gist:
https://gist.github.com/thodison/3dfcff7d09560357c9c6a9b453e0d6ed
*2.Edit ~/.bashrc
Add the folloing line on the top, then save and close it:
alias python3="python3.6"
then on the terminal, run:
source ~/.bashrc
python3 --version //3.6.4
*3.Completely remove youtube-dl
sudo apt-get remove -y youtube-dl
sudo apt-get autoremove --purge youtube-dl
*Use other commands to find related files and delete them.
*4. Install youtube-dl:
sudo pip3 install youtube-dl
youtube-dl -v # Now youtube-dl is using python 3.6
*5.Upgrade:
sudo pip3 install --upgrade youtube-dl
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment