1 (edited by combnum 2021-08-19 23:06:55)

Topic: [SOLVED] cleanup_amavisd_db.py: No module named 'settings'

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): iRedAdmin-1.4
- Deployed with iRedMail Easy or the downloadable installer? downloaded
- Linux/BSD distribution name and version: Ubuntu 20.04.3
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MariaDB 10.3.31
- Web server (Apache or Nginx): nginx 1.18.0
- Manage mail accounts with iRedAdmin-Pro? No
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

root@host:~# python3 /opt/www/iredadmin/tools/cleanup_amavisd_db.py
Traceback (most recent call last):
  File "/opt/www/iredadmin/tools/cleanup_amavisd_db.py", line 41, in <module>
    import settings
ModuleNotFoundError: No module named 'settings'

root@host:~# pip3 install settings
ERROR: Could not find a version that satisfies the requirement settings (from versions: none)
ERROR: No matching distribution found for settings

Any help appreciated, thanks.

Regards

----

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

2

Re: [SOLVED] cleanup_amavisd_db.py: No module named 'settings'

combnum wrote:

ModuleNotFoundError: No module named 'settings'

Do you have file /opt/www/iredadmin/settings.py? Please show us command output:

ls -l /opt/www/iredadmin/settings.py

3

Re: [SOLVED] cleanup_amavisd_db.py: No module named 'settings'

ZhangHuangbin wrote:
combnum wrote:

ModuleNotFoundError: No module named 'settings'

Do you have file /opt/www/iredadmin/settings.py? Please show us command output:

ls -l /opt/www/iredadmin/settings.py

Nope, settings.py is missing in iRedAdmin-1.4 directory, while not missing in previous iRedAdmin-1.0.

What would you advise to do?

Copy /opt/www/iRedAdmin-1.0/settings.py in /opt/www/iRedAdmin-1.4 for instance?

4 (edited by combnum 2021-08-19 23:10:34)

Re: [SOLVED] cleanup_amavisd_db.py: No module named 'settings'

OK, understood. I had to setup settings.py from one of the examples provided.

And then settings.py exists and cleanup_amavisd_db.py works fine and other python scripts referencing settings.py too.

Sorry for the inconvenience.

5

Re: [SOLVED] cleanup_amavisd_db.py: No module named 'settings'

If you follow our tutorial to upgrade iRedAdmin (or iRedAdmin-Pro), the "settings.py" will be copied to new version directory and no need to generate it manually. So i guess you "upgraded" the iRedAdmin by downloading and extracting files, but not ran the upgrade script. Am i right?

https://docs.iredmail.org/iredadmin-pro.releases.html

6

Re: [SOLVED] cleanup_amavisd_db.py: No module named 'settings'

Hi ZhangHuangbin.
Yes, right.