Discussion:
ModuleNotFoundError for youtube_dl
(too old to reply)
Tim Johnson
2024-12-09 23:59:49 UTC
Permalink
Recently did a refresh of ubuntu 24.04

With no code changes am now getting a *ModuleNotFoundError *for youtube_dl

Relevant code is

import sys
sys.path.append("/home/tim/.local/share/pipx/venvs/youtube-dl/lib/python3.12/site-packages/youtube_dl")

import youtube_dl '

Navigating to
/home/tim/.local/share/pipx/venvs/youtube-dl/lib/python3.12/site-packages/youtube_dl,

I see the following

***@beelink:~/.local/share/pipx/venvs/youtube-dl/lib/python3.12/site-packages/youtube_dl$
ls
aes.py    compat.py   extractor    jsinterp.py  options.py __pycache__ 
swfinterp.py  utils.py    YoutubeDL.py
cache.py  downloader  __init__.py  __main__.py  postprocessor
socks.py     update.py     version.py

I've been retired from python programming for 10 years now, and just
tinker or write stuff for myself to

use on my own workstation, so I have obviously forgotten a lot (if you
don't use it you lose it, right)

I hope that someone can help me correct this.

thanks

tim
Tim Johnson
2024-12-10 01:41:15 UTC
Permalink
Post by Tim Johnson
Recently did a refresh of ubuntu 24.04
With no code changes am now getting a *ModuleNotFoundError *for youtube_dl
Relevant code is
import sys
sys.path.append("/home/tim/.local/share/pipx/venvs/youtube-dl/lib/python3.12/site-packages/youtube_dl")
import youtube_dl '
Navigating to
/home/tim/.local/share/pipx/venvs/youtube-dl/lib/python3.12/site-packages/youtube_dl,
I see the following
ls
aes.py    compat.py   extractor    jsinterp.py  options.py
__pycache__  swfinterp.py  utils.py    YoutubeDL.py
cache.py  downloader  __init__.py  __main__.py  postprocessor
socks.py     update.py     version.
I should not have appended 'youtube_dl' to the path. I used the content
from
/home/tim/.local/share/pipx/shared/lib/python3.12/site-packages/pipx_shared.pth

("/home/tim/.local/share/pipx/shared/lib/python3.12/site-packages") and
added that to /usr/lib/python3.12/sitecustomize.py as appended to sys.path

and it appears to be solved.
jkn
2024-12-10 22:35:22 UTC
Permalink
Post by Tim Johnson
Post by Tim Johnson
Recently did a refresh of ubuntu 24.04
With no code changes am now getting a *ModuleNotFoundError *for youtube_dl
Relevant code is
import sys
sys.path.append("/home/tim/.local/share/pipx/venvs/youtube-dl/lib/python3.12/site-packages/youtube_dl")
import youtube_dl '
Navigating to
/home/tim/.local/share/pipx/venvs/youtube-dl/lib/python3.12/site-packages/youtube_dl,
I see the following
aes.py    compat.py   extractor    jsinterp.py  options.py
__pycache__  swfinterp.py  utils.py    YoutubeDL.py
cache.py  downloader  __init__.py  __main__.py  postprocessor
socks.py     update.py     version.
I should not have appended 'youtube_dl' to the path. I used the content
from
/home/tim/.local/share/pipx/shared/lib/python3.12/site-packages/pipx_shared.pth
("/home/tim/.local/share/pipx/shared/lib/python3.12/site-packages") and
added that to /usr/lib/python3.12/sitecustomize.py as appended to sys.path
and it appears to be solved.
FWIW I think youtube_dl has largely been supplanted by the (maintained)
'yt-dlp' these days

J^n

Loading...