Update Raspberry Python 3 install thread

Hello

since Python 2 is EOL. Can the thread to install it on a Raspberry be updated to python 3 command line?

I’ve updated the thread as requested, please test and confirm this works.

Hello echel0n

2 first line had to be executed with sudo

last line send this message

with Sudo
[email protected]:/opt/sickrage $ sudo python3 /opt/sickrage/SiCKRAGE.py

Traceback (most recent call last):
  File "/opt/sickrage/sickrage/__init__.py", line 222, in main
    from sickrage.core import Core
  File "/opt/sickrage/sickrage/core/__init__.py", line 37, in <module>
    from apscheduler.schedulers.tornado import TornadoScheduler
ModuleNotFoundError: No module named 'apscheduler'

without Sudo

[email protected]:/opt/sickrage $ python3 /opt/sickrage/SiCKRAGE.py
Traceback (most recent call last):
  File "/opt/sickrage/SiCKRAGE.py", line 28, in <module>
    [p.unlink() for p in pathlib.Path(os.path.dirname(__file__)).rglob('*.py[co]')]
  File "/opt/sickrage/SiCKRAGE.py", line 28, in <listcomp>
    [p.unlink() for p in pathlib.Path(os.path.dirname(__file__)).rglob('*.py[co]')]
  File "/usr/lib/python3.7/pathlib.py", line 1287, in unlink
    self._accessor.unlink(self)
PermissionError: [Errno 13] Permission denied: '/opt/sickrage/sickrage/core/__pycache__/__init__.cpython-37.pyc'

thanks

FYI
Software

[email protected]:/opt/sickrage $ cat /etc/debian_version
10.1

Hardware

Raspberry 4

will try tomorrow on raspberry 3

thanks

Hello tested on R3 with raspbian Buster

[email protected]:/opt/sickrage $ cat /etc/debian_version
10.1

so the correct lines are

sudo apt install git python3-cryptography python3-openssl python3-lxml python3-pip
sudo git clone https://git.sickrage.ca/SiCKRAGE/sickrage /opt/sickrage
sudo pip3 install -r /opt/sickrage/requirements.txt
sudo python3 /opt/sickrage/SiCKRAGE.py

2 pythin packages are not present by default (python3-lxml python3-pip)

manual start work well, automatique start failed , f i follow this:

sudo cp -v /opt/sickrage/runscripts/init.systemd /etc/systemd/system/sickrage.service
sudo chown root:root /etc/systemd/system/sickrage.service
sudo chmod 644 /etc/systemd/system/sickrage.service
sudo systemctl enable sickrage
sudo systemctl start sickrage
sudo systemctl status sickrage

the error messages are:

[email protected]:~ $ sudo systemctl status sickrage
● sickrage.service - SickRage Daemon
   Loaded: loaded (/etc/systemd/system/sickrage.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sat 2019-11-16 08:58:08 GMT; 2min 2s ago
  Process: 547 ExecStart=/usr/bin/python3 /opt/sickrage/SiCKRAGE.py -q --daemon --nolaunch --datadir=/opt/sickrage **(code=exited, status=217/USER)**

Nov 16 08:58:08 haha systemd[1]: sickrage.service: Service RestartSec=100ms expired, scheduling restart.
Nov 16 08:58:08 haha systemd[1]: sickrage.service: Scheduled restart job, restart counter is at 5.
Nov 16 08:58:08 haha systemd[1]: Stopped SickRage Daemon.
**Nov 16 08:58:08 haha systemd[1]: sickrage.service: Start request repeated too quickly.**
**Nov 16 08:58:08 haha systemd[1]: sickrage.service: Failed with result 'exit-code'.**
Nov 16 08:58:08 haha systemd[1]: Failed to start SickRage Daemon.

any suggestion?

thanks and much appreciated all the work done

I’ve updated the howto, please see the changes made to resolve this issue.

Hello

ok the error seems to come because the service don’t have a user account

Nov 16 18:13:30 haha systemd[775]: sickrage.service: Failed to determine user credentials: No such process
Nov 16 18:13:30 haha systemd[775]: sickrage.service: Failed at step USER spawning /usr/bin/python3: No such process
Nov 16 18:13:30 haha systemd[1]: sickrage.service: Control process exited, code=exited, status=217/USER
Nov 16 18:13:30 haha systemd[1]: sickrage.service: Failed with result 'exit-code'.
Nov 16 18:13:30 haha systemd[1]: sickrage.service: Service RestartSec=100ms expired, scheduling restart.
Nov 16 18:13:30 haha systemd[1]: sickrage.service: Scheduled restart job, restart counter is at 5.
Nov 16 18:13:30 haha systemd[1]: sickrage.service: Start request repeated too quickly.
Nov 16 18:13:30 haha systemd[1]: sickrage.service: Failed with result 'exit-code'.

the config sickrage.service had info for a user account

[Unit]
Description=SickRage Daemon
After=network-online.target

[Service]
User=sickrage
Group=sickrage

Type=forking
GuessMainPID=no
ExecStart=/usr/bin/python3 /opt/sickrage/SiCKRAGE.py -q --daemon --nolaunch --datadir=/opt/sickrage
Restart=on-failure
TimeoutStopSec=300

and the /etc/passwd and /etc/group files do not have sickrage user/group

after creating them, i try to start again the service but with another failure

Nov 16 18:40:39 haha systemd[1]: sickrage.service: Control process exited, code=exited, status=1/FAILURE
Nov 16 18:40:39 haha systemd[1]: sickrage.service: Failed with result 'exit-code'.
Nov 16 18:40:39 haha systemd[1]: sickrage.service: Service RestartSec=100ms expired, scheduling restart.
Nov 16 18:40:39 haha systemd[1]: sickrage.service: Scheduled restart job, restart counter is at 1.
Nov 16 18:40:39 haha systemd[1]: sickrage.service: Control process exited, code=exited, status=1/FAILURE
Nov 16 18:40:39 haha systemd[1]: sickrage.service: Failed with result 'exit-code'.
Nov 16 18:40:39 haha systemd[1]: sickrage.service: Service RestartSec=100ms expired, scheduling restart.
Nov 16 18:40:39 haha systemd[1]: sickrage.service: Scheduled restart job, restart counter is at 2.
Nov 16 18:40:39 haha systemd[1]: sickrage.service: Control process exited, code=exited, status=1/FAILURE
Nov 16 18:40:39 haha systemd[1]: sickrage.service: Failed with result 'exit-code'.
Nov 16 18:40:39 haha systemd[1]: sickrage.service: Service RestartSec=100ms expired, scheduling restart.
Nov 16 18:40:39 haha systemd[1]: sickrage.service: Scheduled restart job, restart counter is at 3.
Nov 16 18:40:39 haha systemd[1]: sickrage.service: Control process exited, code=exited, status=1/FAILURE
Nov 16 18:40:39 haha systemd[1]: sickrage.service: Failed with result 'exit-code'.
Nov 16 18:40:40 haha systemd[1]: sickrage.service: Service RestartSec=100ms expired, scheduling restart.
Nov 16 18:40:40 haha systemd[1]: sickrage.service: Scheduled restart job, restart counter is at 4.
Nov 16 18:40:40 haha systemd[1]: sickrage.service: Control process exited, code=exited, status=1/FAILURE
Nov 16 18:40:40 haha systemd[1]: sickrage.service: Failed with result 'exit-code'.
Nov 16 18:40:40 haha systemd[1]: sickrage.service: Service RestartSec=100ms expired, scheduling restart.
Nov 16 18:40:40 haha systemd[1]: sickrage.service: Scheduled restart job, restart counter is at 5.
Nov 16 18:40:40 haha systemd[1]: sickrage.service: Start request repeated too quickly.
Nov 16 18:40:40 haha systemd[1]: sickrage.service: Failed with result 'exit-code'.

Try removing that from the init script and let me know if its fixed

Hello

i removed everything anf followed the updated version of the thread line by line

it"s working now as a charm :slight_smile:

thanks !
tonic8

Thank you for helping with re-doing the howto, many others will benefit from this as well :slight_smile: