[Pkg-mailman-hackers] Bug#962666: ModuleNotFoundError: No module named 'MySQLdb'

Pierre-Elliott Bécue peb at debian.org
Thu Jul 2 21:16:40 BST 2020


Control: tag -1 +moreinfo

Le jeudi 11 juin 2020 à 16:22:37+0200, Olaf Zaplinski a écrit :
> Package: mailman3-web
> Version: 0+20180916-8
> Severity: normal
> 
> Dear Maintainer,
> 
> on a fresh installed Debian host I have installed mariadb-server first and then mailman3-full.
> 
> Auto configuration of mailman3-web fails:
> 
> 
> 
> Creating config file /etc/mailman3/mailman-hyperkitty.cfg with new version
> Setting up g++ (4:8.3.0-1) ...
> update-alternatives: using /usr/bin/g++ to provide /usr/bin/c++ (c++) in auto mode
> Setting up python3-django-postorius (1.2.4-1) ...
> Setting up python3-django-hyperkitty (1.2.2-1) ...
> Setting up mailman3-web (0+20180916-8) ...
> Determining localhost credentials from /etc/mysql/debian.cnf: succeeded.
> dbconfig-common: writing config to /etc/dbconfig-common/mailman3-web.conf
> 
> Creating config file /etc/dbconfig-common/mailman3-web.conf with new version
> checking privileges on database mailman3web for mailman3web at localhost: user creation needed.
> granting access to database mailman3web for mailman3web at localhost: success.
> verifying access for mailman3web at localhost: success.
> creating database mailman3web: already exists.
> dbconfig-common: flushing administrative password
> 
> Creating config file /etc/mailman3/mailman-web.py with new version
> Traceback (most recent call last):
>   File "/usr/lib/python3/dist-packages/django/db/backends/mysql/base.py", line 26, in <module>
>     import MySQLdb as Database
> ModuleNotFoundError: No module named 'MySQLdb'
> 
> During handling of the above exception, another exception occurred:
> 
> Traceback (most recent call last):
>   File "/usr/bin/django-admin", line 21, in <module>
>     management.execute_from_command_line()
>   File "/usr/lib/python3/dist-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
>     utility.execute()
>   File "/usr/lib/python3/dist-packages/django/core/management/__init__.py", line 338, in execute
>     django.setup()
>   File "/usr/lib/python3/dist-packages/django/__init__.py", line 27, in setup
>     apps.populate(settings.INSTALLED_APPS)
>   File "/usr/lib/python3/dist-packages/django/apps/registry.py", line 108, in populate
>     app_config.import_models()
>   File "/usr/lib/python3/dist-packages/django/apps/config.py", line 202, in import_models
>     self.models_module = import_module(models_module_name)
>   File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
>     return _bootstrap._gcd_import(name[level:], package, level)
>   File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
>   File "<frozen importlib._bootstrap>", line 983, in _find_and_load
>   File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
>   File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
>   File "<frozen importlib._bootstrap_external>", line 728, in exec_module
>   File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
>   File "/usr/lib/python3/dist-packages/hyperkitty/models/__init__.py", line 25, in <module>
>     from .category import ThreadCategory
>   File "/usr/lib/python3/dist-packages/hyperkitty/models/category.py", line 61, in <module>
>     class ThreadCategory(models.Model):
>   File "/usr/lib/python3/dist-packages/django/db/models/base.py", line 124, in __new__
>     new_class.add_to_class('_meta', Options(meta, app_label))
>   File "/usr/lib/python3/dist-packages/django/db/models/base.py", line 325, in add_to_class
>     value.contribute_to_class(cls, name)
>   File "/usr/lib/python3/dist-packages/django/db/models/options.py", line 214, in contribute_to_class
>     self.db_table = truncate_name(self.db_table, connection.ops.max_name_length())
>   File "/usr/lib/python3/dist-packages/django/db/__init__.py", line 33, in __getattr__
>     return getattr(connections[DEFAULT_DB_ALIAS], item)
>   File "/usr/lib/python3/dist-packages/django/db/utils.py", line 211, in __getitem__
>     backend = load_backend(db['ENGINE'])
>   File "/usr/lib/python3/dist-packages/django/db/utils.py", line 115, in load_backend
>     return import_module('%s.base' % backend_name)
>   File "/usr/lib/python3.7/importlib/__init__.py", line 127, in import_module
>     return _bootstrap._gcd_import(name[level:], package, level)
>   File "/usr/lib/python3/dist-packages/django/db/backends/mysql/base.py", line 30, in <module>
>     'Did you install mysqlclient or MySQL-python?' % e
> django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named 'MySQLdb'.
> Did you install mysqlclient or MySQL-python?
> dpkg: error processing package mailman3-web (--configure):
>  installed mailman3-web package post-installation script subprocess returned error exit status 1
> dpkg: dependency problems prevent configuration of mailman3-full:
>  mailman3-full depends on mailman3-web (>= 0+20180916-1); however:
>   Package mailman3-web is not configured yet.

You did not provide the whole apt install logs, but I'm pretty sure you
did not install python3-mysqldb, and hence when installing mailman3-web,
it'll try the first package to resolve the dependency "python3-psycopg2
| python3-mysqldb", which is python3-psycopg2.

Can you give me the full command andd logs you got?

Normally apt install python3-mysqldb dbconfig-mysql mailman3-full should
work.

-- 
Pierre-Elliott Bécue
GPG: 9AE0 4D98 6400 E3B6 7528  F493 0D44 2664 1949 74E2
It's far easier to fight for one's principles than to live up to them.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/pkg-mailman-hackers/attachments/20200702/49526fd8/attachment.sig>


More information about the Pkg-mailman-hackers mailing list