[Solved] Missing module: cgi [Debian Bullseye]

Support for the Debian/Ubuntu package, created by JCFP.
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.
Post Reply
tcd
Newbie
Newbie
Posts: 5
Joined: October 16th, 2021, 12:48 am

[Solved] Missing module: cgi [Debian Bullseye]

Post by tcd »

Hi everyone,

I have a little problem to start sabnzb after upgrade from Debian Buster to Bullseye. After start follow message

Code: Select all

Not all required Python modules are available, please check requirements.txt
Missing module: cgi
I checked all requirements via

Code: Select all

python3 -m pip install -r requirements.txt -U
But there is no module cgi. Also there is no python3-cgi module. I tryed also to install sabnzbplus from Debian source for dependencies. But nothing helps.

How can I fix this problem?

PS: On Buster sabnzb runs very well with Version 3.4.2
Last edited by tcd on October 17th, 2021, 8:28 am, edited 1 time in total.
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: Missing module: cgi [debian bullseye]

Post by sander »

cgi is part of The Python Standard Library, and thus a standard python install.

On a clean bullseye docker with only python3 installed, it's there:

Code: Select all

root@796f6dd61eef:/# python3
Python 3.9.2 (default, Feb 28 2021, 17:03:44) 
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cgi
>>> 

Code: Select all

root@1881c8013419:/# find / -name cgi\* | grep python
/usr/lib/python3.9/cgi.py
/usr/lib/python3.9/cgitb.py
/usr/lib/python3.9/__pycache__/cgitb.cpython-39.pyc
/usr/lib/python3.9/__pycache__/cgi.cpython-39.pyc


So recheck your python3 install
tcd
Newbie
Newbie
Posts: 5
Joined: October 16th, 2021, 12:48 am

Re: Missing module: cgi [debian bullseye]

Post by tcd »

Here almost the same output. I cannot show the output here, because I don´t have permission to post links. (Even marked as Code)

I tried a reinstall of python3 and all modules. The same result. The local sabnzb (from source) won´t start. The original Bullseyeversion runs well.
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: Missing module: cgi [debian bullseye]

Post by sander »

Almost?
User avatar
jcfp
Release Testers
Release Testers
Posts: 986
Joined: February 7th, 2008, 12:45 pm

Re: Missing module: cgi [debian bullseye]

Post by jcfp »

As sander mentioined, cgi is part of the python standard library and thus always installed with the python interpreter package.

Do you see better results if you call python3.9 directly (instead of 'python3')? Or in a fresh user account without any pip stuff or other modifications from prior to upgrading Debian?
tcd
Newbie
Newbie
Posts: 5
Joined: October 16th, 2021, 12:48 am

Re: Missing module: cgi [debian bullseye]

Post by tcd »

Here is the output in other way. :-D

Image

And here, when I tried with calling python3.9 directly and with a normal user

Image

And the same with a new and fresh user

Image
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: Missing module: cgi [debian bullseye]

Post by sander »

This is a OS / Python problem. Not SABnzbd related. And out of my league. So I'll unsubsribe from this thread.
tcd
Newbie
Newbie
Posts: 5
Joined: October 16th, 2021, 12:48 am

Re: Missing module: cgi [debian bullseye]

Post by tcd »

No problem, anyway thanks for help!
tcd
Newbie
Newbie
Posts: 5
Joined: October 16th, 2021, 12:48 am

Re: Missing module: cgi [debian bullseye]

Post by tcd »

With help from a very friendly User from german Debianforum, I found the solution.

Via "strace" I saw, that sabnzbd try to use a python module inside of sabnzbd directory. (/usr/local/bin/sabnzbd/cherrypy). I don´t know why. But all other python modules normaly in /usr/local/lib... So, the cherrypy module try to find other modules in the same dir. Of course the script can´t find any other and stops working.

I delete the complete directory except the ini file and installed the original source from here. Now it´s working very well. ;D
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: [Solved] Missing module: cgi [Debian Bullseye]

Post by sander »

strace is a nice tool.

Cool it's solved.


/usr/local/bin/sabnzbd/cherrypy is strange as "cherrypy" is not shipped by SABnzbd.
Post Reply