Deprecated: Use of "parent" in callables is deprecated in /var/www/html/forum/src/vendor/league/flysystem-eventable-filesystem/src/EventableFilesystem.php on line 431
  • If you need help or want to discuss things, you now can also join us on our Discord Server!
  • A first preview of the unlimited version of SinusBot can be found in the Upcoming Changes thread. A version for Windows will follow, but we don't have a release date, yet.

Is there a way to have Sinusbot specify a Python version when calling yt-dlp?

Kashinoda

Member
Hello,

Recently yt-dlp moved to Python 3.7, I have this installed on my 18.04 Ubuntu distro but things break when switching the main version in the OS itself so 3.7 is only an alternative option.

I can run yt-dlp by entering python 3.7 ./yt-dlp in terminal but updating the config.ini for Sinusbot in a simlar way does not work, i.e.:
Code:
YoutubeDLPath = "python3.7 /opt/sinusbot/yt-dlp"

I also tried making an sh script which opens yt-dlp with Python 3.7 but that doesn't work either:
Code:
YoutubeDLPath = "/opt/sinusbot/yt-dlp.sh"

If I switch my OS to use Python 3.7 it does work normally, but it isn't possible to run this permanently

Sinusbot version: 1.0.0-beta.14-dc94a7c

Thanks
 

Kashinoda

Member
For anyone else who has this problem, here's a non-elegant solution.

Install virtualenv and screen if you don't already have them:
Code:
sudo apt-get install virtualenv screen

Login to your sinusbot account
Code:
su - sinusbot

Create a Python 3.7 virtual envrionement:
Code:
virtualenv --python=python3.7 .venv

Create a new screen session
Code:
screen -S sinusbot

Activate your virtual envirtonment by running:
Code:
source .venv/bin/activate

Start sinusbot
Code:
/opt/sinusbot/sinusbot

Exit your screen session with CTRL + A and press D

Note I tried to edit the service file at /lib/systemd/system/sinusbot.service but could not find the correct way to use virtualenv: https://stackoverflow.com/questions/37211115/how-to-enable-a-virtualenv-in-a-systemd-service-unit
 
Top