1

Topic: 'web' module missing after upgrade to Ubuntu 20.04

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 1.3.1
- Deployed with iRedMail Easy or the downloadable installer? Downloadable
- Linux/BSD distribution name and version: Ubuntu 20.04
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Apache
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====
Upgraded the server to Ubuntu 20.04 from 18.04 (and SoGo to V5) and started getting these errors emailed to me from the cron jobs:

  
python /opt/www/iredadmin/tools/cleanup_amavisd_db.py >/dev/null
File "/opt/www/iredadmin/tools/cleanup_amavisd_db.py", line 34, in <module>
    import web
ImportError: No module named web 

and

python /opt/www/iredadmin/tools/delete_mailboxes.py
Traceback (most recent call last):
  File "/opt/www/iredadmin/tools/delete_mailboxes.py", line 43, in <module>
    import web
ImportError: No module named web

Please advise any steps to fix.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: 'web' module missing after upgrade to Ubuntu 20.04

Please run commands below to fix it:

wget https://bootstrap.pypa.io/get-pip.py
python2 get-pip.py
pip2 install web.py==0.51

Note: upcoming iRedAdmin(-Pro) will drop Python 2 support completely and moves to Python 3.

3 (edited by Stubby066 2020-10-11 00:53:14)

Re: 'web' module missing after upgrade to Ubuntu 20.04

Thanks.

Now getting this error:

python /opt/www/iredadmin/tools/delete_mailboxes.py

 <<< ERROR >>> Cannot connect to SQL database, aborted. Error: TypeError("cannot concatenate 'str' and 'exceptions.ImportError' objects",)

4

Re: 'web' module missing after upgrade to Ubuntu 20.04

Seems to be fixed with:

 sudo pip install mysql-connector-python

Returns the following warning, but as you mentioned you will be upgrading to python 3:

DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support pip 21.0 will remove support for this functionality.