Error with pip3 updating youtube-dl #411
BentWrench
started this conversation in
General
Replies: 1 comment 1 reply
-
|
Fixed in 1.5.2 https://github.com/vicwomg/pikaraoke/releases/tag/1.5.2 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello All,
My post seems to be a duplicate of [BUG] #402
#402
TL;DR: Pi 1.51 has a bug that will stop Pi Karaoke from launching due to the failure of the youtube-dl update. If you then install into the venv (virtual environment for Python) the youtube-dl update works, but launching using the autostart file doesn't seem to work. A work-around is setting Pi Karaoke up as a service, but that makes it difficult to reboot or shutdown the Pi.
I had a lot of issues resolving this problem. I tried setting up the venv and then using autostart to launch Pi Karaoke, but that didn't work for some reason. I setup the script and auto launch file.
#!/bin/sh
source /home/pi/.venv/bin/activate
pikaraoke
and
[Desktop Entry]
Type=Application
Name=Pikaraoke
Exec=/home/pi/launch-pikaraoke-venv.sh
I can launch it from a terminal with the commands:
source /home/pi/.venv/bin/activateandpikaraokebut they won't launch from the launch-pikaraoke-venc.sh script.I was able to setup Pi Karaoke in venv as a service. Below is the contents of my service file. It will launch Pi Karaoke on the desktop, so if you are connecting your Pi to a TV or monitor, it will load full screen after it boots to the desktop. It will successfully update youtube downloader. I do not use headless mode, if you do, copy the service file from [BUG] #402.
To install this, create a file named pikaraoke.service, copy it to the /etc/systemd/service/ folder, and then enable auto start of the service with sudo systemctl enable pikaraoke.service. The downside to running as a service, the Shutdown and Reboot commands from the web interface don't work anymore.
Start copying at the next line:
[Unit]
Description=pikaraoke
After=graphical.target
[Service]
WorkingDirectory=/home/pi/.venv/
Type=simple
ExecStart=/home/pi/.venv/bin/python /home/pi/.venv/bin/pikaraoke --download-path /home/pi/pikaraoke-songs --volume 0.90
User=pi
Group=pi
Environment="PATH=$PATH:/home/pi/.venv/bin:/home/pi/.venv/lib/python3.11/site-packages:/usr/bin:/user/sbin"
Environment="DISPLAY=:0"
Restart=on-failure
RestartSec=45
[Install]
WantedBy=graphical.target
End copying at the line above.
Here is my original post about the youtube downloader error breaking Pi Karaoke:
I am getting an error in Pi Karaoke 1.51 when it launches. I use this Pi 4 only for Pi Karaoke and it is set to auto start. When I installed it, I used the option to not use a venv for Python.
When I try to launch I get this error below. Should I just re-install using the venv option?
pi@pikaraoke:~ $ pikaraoke
[2024-10-27 11:04:01] INFO: Fetching available songs in: /home/pi/pikaraoke-songs/
[2024-10-27 11:04:02] INFO: Upgrading youtube-dl, current version: 2024.10.07
[2024-10-27 11:04:04] INFO: Current version: [email protected] from yt-dlp/yt-dlp
Latest version: [email protected] from yt-dlp/yt-dlp
ERROR: You installed yt-dlp with pip or using the wheel from PyPi; Use that to update
[2024-10-27 11:04:04] INFO: Attempting youtube-dl upgrade via pip3...
error: externally-managed-environment
× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.
note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
Traceback (most recent call last):
File "/home/pi/.local/bin/pikaraoke", line 8, in
sys.exit(main())
^^^^^^
File "/home/pi/.local/lib/python3.11/site-packages/pikaraoke/app.py", line 910, in main
k.upgrade_youtubedl()
File "/home/pi/.local/lib/python3.11/site-packages/pikaraoke/karaoke.py", line 251, in upgrade_youtubedl
output = check_output(["pip3", "install", "--upgrade", "yt-dlp"]).decode("utf8")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/subprocess.py", line 466, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/subprocess.py", line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['pip3', 'install', '--upgrade', 'yt-dlp']' returned non-zero exit status 1.
pi@pikaraoke:~ $
Beta Was this translation helpful? Give feedback.
All reactions