Upgrade Help ... sabctools ... OSMC

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
chewiesw
Newbie
Newbie
Posts: 15
Joined: April 23rd, 2012, 11:55 am

Upgrade Help ... sabctools ... OSMC

Post by chewiesw »

Hi

I am trying to upgrade my SABNzb version from ver 3.1.1 to the latest on my OSMC box. I am running Python version 3.9.2. I would like to keep the original config if possible.

I am running into a few errors , I have downloaded an unpacked the tar to my home directory when I try to run the sabnzbd.py script, it errors with missing module : sabctools

I tried to follow int instructions to resolve this by installing pip, when I get to this command “sudo -H pip install sabctools –upgrade” I get the error

ERROR: Could not build wheels for sabctools which use PEP 517 and cannot be installed directly.

I upgraded pip and still get an error

ERROR: Could not build wheels for sabctools, which is required to install pyproject.toml-based projects

Any idea what I do now.
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: Upgrade Help ... sabctools ... OSMC

Post by sander »

is your OSMC box x86, or some special CPU (like ARM)?
chewiesw
Newbie
Newbie
Posts: 15
Joined: April 23rd, 2012, 11:55 am

Re: Upgrade Help ... sabctools ... OSMC

Post by chewiesw »

ARM - Raspberry Pi 4
chewiesw
Newbie
Newbie
Posts: 15
Joined: April 23rd, 2012, 11:55 am

Re: Upgrade Help ... bdist / cffi ... OSMC

Post by chewiesw »

UPDATE: I have got a little further. I ran this command " pip3 install --upgrade -r requirements.txt "

I now get this error.

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> [67 lines of output]
Collecting setuptools!=60.9.0,>=40.6.0
Using cached setuptools-67.8.0-py3-none-any.whl (1.1 MB)
Collecting wheel
Using cached wheel-0.40.0-py3-none-any.whl (64 kB)
Collecting cffi>=1.12
Using cached cffi-1.15.1.tar.gz (508 kB)
Preparing metadata (setup.py): started
Preparing metadata (setup.py): finished with status 'done'
Collecting setuptools-rust>=0.11.4
Downloading setuptools_rust-1.6.0-py3-none-any.whl (23 kB)
Collecting pycparser (from cffi>=1.12)
Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB)
Collecting semantic-version<3,>=2.8.2 (from setuptools-rust>=0.11.4)
Downloading semantic_version-2.10.0-py2.py3-none-any.whl (15 kB)
Collecting typing-extensions>=3.7.4.3 (from setuptools-rust>=0.11.4)
Downloading typing_extensions-4.6.3-py3-none-any.whl (31 kB)
Building wheels for collected packages: cffi
Building wheel for cffi (setup.py): started
Building wheel for cffi (setup.py): finished with status 'error'
error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [36 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-aarch64-3.9
creating build/lib.linux-aarch64-3.9/cffi
copying cffi/verifier.py -> build/lib.linux-aarch64-3.9/cffi
copying cffi/backend_ctypes.py -> build/lib.linux-aarch64-3.9/cffi
copying cffi/__init__.py -> build/lib.linux-aarch64-3.9/cffi
copying cffi/setuptools_ext.py -> build/lib.linux-aarch64-3.9/cffi
copying cffi/cffi_opcode.py -> build/lib.linux-aarch64-3.9/cffi
copying cffi/ffiplatform.py -> build/lib.linux-aarch64-3.9/cffi
copying cffi/cparser.py -> build/lib.linux-aarch64-3.9/cffi
copying cffi/commontypes.py -> build/lib.linux-aarch64-3.9/cffi
copying cffi/error.py -> build/lib.linux-aarch64-3.9/cffi
copying cffi/pkgconfig.py -> build/lib.linux-aarch64-3.9/cffi
copying cffi/model.py -> build/lib.linux-aarch64-3.9/cffi
copying cffi/vengine_gen.py -> build/lib.linux-aarch64-3.9/cffi
copying cffi/lock.py -> build/lib.linux-aarch64-3.9/cffi
copying cffi/recompiler.py -> build/lib.linux-aarch64-3.9/cffi
copying cffi/vengine_cpy.py -> build/lib.linux-aarch64-3.9/cffi
copying cffi/api.py -> build/lib.linux-aarch64-3.9/cffi
copying cffi/_cffi_include.h -> build/lib.linux-aarch64-3.9/cffi
copying cffi/parse_c_type.h -> build/lib.linux-aarch64-3.9/cffi
copying cffi/_embedding.h -> build/lib.linux-aarch64-3.9/cffi
copying cffi/_cffi_errors.h -> build/lib.linux-aarch64-3.9/cffi
running build_ext
building '_cffi_backend' extension
creating build/temp.linux-aarch64-3.9
creating build/temp.linux-aarch64-3.9/c
arm-linux-gnueabihf-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/build/python3.9-jS0VHk/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -ffile-prefix-map=/build/python3.9-jS0VHk/python3.9-3.9.2=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -DFFI_BUILDING=1 -DUSE__THREAD -DHAVE_SYNC_SYNCHRONIZE -I/usr/include/ffi -I/usr/include/libffi -I/usr/include/python3.9 -c c/_cffi_backend.c -o build/temp.linux-aarch64-3.9/c/_cffi_backend.o
c/_cffi_backend.c:2:10: fatal error: Python.h: No such file or directory
2 | #include <Python.h>
| ^~~~~~~~~~
compilation terminated.
error: command '/usr/bin/arm-linux-gnueabihf-gcc' failed with exit code 1
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for cffi
Running setup.py clean for cffi
Failed to build cffi
ERROR: Could not build wheels for cffi, which is required to install pyproject.toml-based projects
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: Upgrade Help ... sabctools ... OSMC

Post by sander »

" fatal error: Python.h: No such file or directory" ... that is easy to solve! First google hit should tell it
chewiesw
Newbie
Newbie
Posts: 15
Joined: April 23rd, 2012, 11:55 am

Re: Upgrade Help ... sabctools ... OSMC

Post by chewiesw »

Two steps forward...

error: failed to get `asn1` as a dependency of package `cryptography-rust v0.1.0 (/tmp/pip-install-dqn3ph4p/cryptography_fd41992ef11b45c4a9fecddd569cb667/src/rust)`

Caused by:
failed to fetch `https://github.com/rust-lang/crates.io-index`

Caused by:
error inflating zlib stream; class=Zlib (5)

=============================DEBUG ASSISTANCE=============================
If you are seeing a compilation error please try the following steps to
successfully install cryptography:
1) Upgrade to the latest pip and try again. This will fix errors for most
users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
2) Read https://cryptography.io/en/latest/installation/ for specific
instructions for your platform.
3) Check our frequently asked questions for more information:
https://cryptography.io/en/latest/faq/
4) Ensure you have a recent Rust toolchain installed:
https://cryptography.io/en/latest/installation/#rust

Python: 3.9.2
platform: Linux-5.15.83-2-osmc-aarch64-with-glibc2.31
pip: n/a
setuptools: 67.8.0
setuptools_rust: 1.6.0
rustc: 1.48.0
=============================DEBUG ASSISTANCE=============================

error: `cargo rustc --lib --message-format=json-render-diagnostics --manifest-path src/rust/Cargo.toml --release -v --features 'pyo3/extension-module pyo3/abi3-py36' -- --crate-type cdylib` failed with code 101
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for cryptography
Building wheel for ujson (pyproject.toml) ... done
Created wheel for ujson: filename=ujson-5.7.0-cp39-cp39-linux_aarch64.whl size=42574 sha256=2797689069969aec3ced1ae0c4d7e8b52903b3b23ae6ad3584ac1f6df70bbab2
Stored in directory: /root/.cache/pip/wheels/6f/02/55/459e764a06847deba8cee4a5f64da4e931a9abfa8589bbde64
Successfully built sabctools cheetah3 cffi ujson
Failed to build cryptography
ERROR: Could not build wheels for cryptography, which is required to install pyproject.toml-based projects
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: Upgrade Help ... sabctools ... OSMC

Post by sander »

... one step back: I'm surprised: I would think that also on Linux-on-ARM pypi / pip would provide sabctools and cyrptography directly, without need for wheels. But pypi & wheels are pure magic / mystery to me, so I could be wrong.

Compiling the cryptography module can be a nasty thing, because AFAIK it needs the rust compiler ... therefore the "rustc" error.

Have you tried: "python3 -m pip install cryptography"?
chewiesw
Newbie
Newbie
Posts: 15
Joined: April 23rd, 2012, 11:55 am

Re: Upgrade Help ... sabctools ... OSMC

Post by chewiesw »

yeah

Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: cryptography in /usr/lib/python3/dist-packages (3.3.2)
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: Upgrade Help ... sabctools ... OSMC

Post by sander »

Ok ... what if you start sabnzbd ... ?
chewiesw
Newbie
Newbie
Posts: 15
Joined: April 23rd, 2012, 11:55 am

Re: Upgrade Help ... sabctools ... OSMC

Post by chewiesw »

I can't. I am not finished installing

osmc@HDPVR:~/SABnzbd-4.0.1$ ls
COPYRIGHT.txt ISSUES.txt SABnzbd.py licenses requirements.txt tools
GPL2.txt LICENSE.txt email linux sabnzbd
GPL3.txt PKG-INFO icons locale scripts
INSTALL.txt README.mkd interfaces po tests
osmc@HDPVR:~/SABnzbd-4.0.1$ ./SABnzbd.py
Not all required Python modules are available, please check requirements.txt
Missing module: sabctools
You can read more at: https://sabnzbd.org/wiki/installation/i ... ff-modules
If you still experience problems, remove all .pyc files in this folder and subfolders
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: Upgrade Help ... sabctools ... OSMC

Post by sander »

Too bad ... library dependency hell. FWIW: I'm reading about immutable linux, with snap or flatpak bringing their own libraries to avoid the above.

As said earlier: I'm surprised it's so difficult on your Linux on ARM. It should be like that.

I'll have access to an ARM wth Linux end of the week, so then I can check.

In the meantime:

* you could try activating the PPA for SABnzbd
* you could install rustc and try again
* wait if @jcfp has better advice
User avatar
OneCD
Hero Member
Hero Member
Posts: 557
Joined: March 4th, 2017, 3:47 pm

Re: Upgrade Help ... sabctools ... OSMC

Post by OneCD »

This might be another case of needing to rebuild a manylinux2014 wheel locally. I have to do this when installing `sabctools` on QNAP NAS. :(

Suggest reinstalling `sabctools` with the `--no-binary` option.
Stuff I like: Apache bash cron DD-WRT Debian DNSMasq Entware FireFox GitHub ImageMagick Kate KDE LibreELEC Netrunner NFS NVIDIA OpenVPN Orvibo-S20 pfSense Python Raspberry-Pi RAID SABnzbd Transmission Usenet VirtualBox Watcher3 XFCE
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: Upgrade Help ... sabctools ... OSMC

Post by sander »

OK, I tried on my Ubuntu on ARM, with jcfp's PPA set up, and it works automagically:

Code: Select all

Get:1 https://ppa.launchpadcontent.net/jcfp/nobetas/ubuntu jammy/main arm64 python3-sabctools arm64 7.0.1-0ubuntu1~jcfp1~22.04 [28.7 kB]
Get:2 https://ppa.launchpadcontent.net/jcfp/nobetas/ubuntu jammy/main arm64 sabnzbdplus all 4.0.2-0ubuntu1~jcfp1~22.04 [740 kB]
And

Code: Select all

2023-06-14 22:15:39,750::INFO::[sabnzbdplus:1173] sabnzbdplus-4.0.2
...
2023-06-14 22:15:40,457::INFO::[sabnzbdplus:426] SABCTools module (v7.0.1)... found!
2023-06-14 22:15:40,459::INFO::[sabnzbdplus:427] SABCTools module is using SIMD set: NEON
2023-06-14 22:15:40,460::INFO::[sabnzbdplus:428] SABCTools module is linked to OpenSSL: True

So most easy is to setup jcfp's PPA.

If / as that does not work for you, see my next post.
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: Upgrade Help ... sabctools ... OSMC

Post by sander »

This is the universal method, using python's venv

Code: Select all

sander@nanopineo2:~$ sudo apt install python3-venv
sander@nanopineo2:~$ python3 -m venv ~/venv-sabnzbd # creat venv-directory for SAB
sander@nanopineo2:~$ source ~/venv-sabnzbd/bin/activate # activate the venv
(venv-sabnzbd) sander@nanopineo2:~$ python3 -m pip install -r ~/git/sabnzbd/requirements.txt
Just installing the modules, no compiling needed, even not on ARM.

... and that works:

Code: Select all

2023-06-14 22:25:06,726::INFO::[SABnzbd:1168] SABnzbd.py-4.1.0-develop
...
2023-06-14 22:25:07,508::INFO::[SABnzbd:425] SABCTools module (v7.1.0)... found!
2023-06-14 22:25:07,510::INFO::[SABnzbd:426] SABCTools module is using SIMD set: NEON
2023-06-14 22:25:07,511::INFO::[SABnzbd:427] SABCTools module is linked to OpenSSL: True
After stopping SABnzbd, you can leave the python venv like this:

Code: Select all

(venv-sabnzbd) sander@nanopineo2:~$ ^C
(venv-sabnzbd) sander@nanopineo2:~$ deactivate 
sander@nanopineo2:~$
HTH
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: Upgrade Help ... sabctools ... OSMC

Post by sander »

And ... @chewiesw ... did it work for you?
Post Reply