Page 1 of 1

[Solved] Missing module: cgi [Debian Bullseye]

Posted: October 16th, 2021, 12:58 am
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

Re: Missing module: cgi [debian bullseye]

Posted: October 16th, 2021, 3:36 am
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

Re: Missing module: cgi [debian bullseye]

Posted: October 16th, 2021, 4:37 am
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.

Re: Missing module: cgi [debian bullseye]

Posted: October 16th, 2021, 5:17 am
by sander
Almost?

Re: Missing module: cgi [debian bullseye]

Posted: October 16th, 2021, 8:22 am
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?

Re: Missing module: cgi [debian bullseye]

Posted: October 16th, 2021, 1:05 pm
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

Re: Missing module: cgi [debian bullseye]

Posted: October 16th, 2021, 1:14 pm
by sander
This is a OS / Python problem. Not SABnzbd related. And out of my league. So I'll unsubsribe from this thread.

Re: Missing module: cgi [debian bullseye]

Posted: October 16th, 2021, 1:19 pm
by tcd
No problem, anyway thanks for help!

Re: Missing module: cgi [debian bullseye]

Posted: October 17th, 2021, 8:27 am
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

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

Posted: October 17th, 2021, 11:59 am
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.