Hello,
I’m a longtime user of various Linux distributions (mostly Ubuntu) but not until I got a Pi, did I really start getting familiar with the command line.
I am currently using UbuntuStudio- VERSION=“20.04.1 LTS (Focal Fossa)” and am having trouble with youtube-dl.
Basically, I’ve updated,installed & uninstalled youtube-dl through so many methods that I’m lost and don’t have a working youtube-dl.
(Note-there’s a restriuction on links for new users. My curl and wget commands have url links to the youtube-dl site.
Wherever there is supposed to be a url, I’ve replaced with “(url goes here)”
i hope this is ok.)
But here’s how it happened:
I succesfully used youtube-dl with a youtube video but minutes later, was unable to download a different video:
So i checked the version of youtube-dl that I was using and found that it was not the latest version “youtube-dl 2020.07.28.”
I then tried to update the version. This is where I messed everything up. I tried without luck:
sudo apt-get update
sudo-apt-get update youtube-dl
And then after various webpages…
37 sudo apt-get install youtube-dl
263 youtube-dl -U
264 sudo apt-get update youtube-dl
265 sudo apt-get update youtube-dl -U
267 youtube-dl -u
268 $ sudo pip install -U youtube-dl
269 $ sudo pip3 install -U youtube-dl
274 sudo pip install -U youtube-dl
275 sudo pip3 install -U youtube-dl
276 sudo apt-get upgrade youtube-dl
277 sudo pip3 install -U youtube-dl
278 sudo apt-get install -U youtube-dl
279 sudo apt-get youtube-dl
280 sudo apt-get install youtube-dl
283 sudo apt-get remove -y youtube-dl
289 sudo apt-get install youtube-dl
290 sudo apt-get remove youtube-dl
292 sudo curl (url goes here)
293 sudo chmod a+rx /usr/local/bin/youtube-dl
301 sudo pip install -U youtube-dl
302 sudo pip3 install -U youtube-dl
304 sudo chmod a+rx /usr/local/bin/youtube-dl
342 sudo wget (url goes here)
343 chmod -R 755 /usr/local/bin/youtube-dl
344 sudo chmod -R 755 /usr/local/bin/youtube-dl
348 pip3 youtube-dl -U
350 sudo snap install youtube-dl
I know, It’s a mess
Anyways, Here’s where i think I stand:
I have these pythons installed:
which python3
/usr/bin/python3
which python2
/usr/bin/python2
I have this youtube-dl folder here
which youtube-dl
/usr/local/bin/youtube-dl
But then:
youtube-dl --version
/usr/bin/env: ‘python’: No such file or directory
Tried to run from: /usr/local/bin/youtube-dl
/usr/local/bin$ youtube-dl (url goes here)
/usr/bin/env: ‘python’: No such file or directory
So then, I remembered my very brief encounter with pip3 (had to use photorec_sort) and tried pip3 install:
sudo pip3 install youtube-dl
Requirement already satisfied: youtube-dl in /usr/local/lib/python3.8/dist-packages (2020.7.28)
Here is what I have in that directory:
/usr/local/lib/python3.8/dist-packages$ ls
youtube_dl youtube_dl-2020.7.28.dist-info
The youtube_dl directory has the YoutubeDL.py program
So I tried this from that directory:
/usr/local/lib/python3.8/dist-packages/youtube_dl$ pwd
/usr/local/lib/python3.8/dist-packages/youtube_dl
/usr/local/lib/python3.8/dist-packages/youtube_dl$ python3 YoutubeDL.py (youtube url goes here)
and this is what I got:
/usr/local/lib/python3.8/dist-packages/youtube_dl$ python3 YoutubeDL.py (youtube url goes here)
Traceback (most recent call last):
File "YoutubeDL.py", line 31, in <module>
from .compat import (
ImportError: attempted relative import with no known parent package
As you can tell, I know just enough linux to get myself in trouble. Can anyone please help me return to a working youtube-dl status?
Thank you in advance,
Zeke