[GH-ISSUE #2285] ModuleNotFoundError: No module named 'distro' #1564

Closed
opened 2026-02-27 11:17:50 +03:00 by kerem · 1 comment
Owner

Originally created by @jamielsharief on GitHub (Jun 25, 2021).
Original GitHub issue: https://github.com/modoboa/modoboa/issues/2285

I am using Ubuntu 20.04, and after following the installation instructions, installation just did not work.

$ sudo ./run.py mail.mydomain.com
Traceback (most recent call last):
  File "/root/modoboa-installer/modoboa_installer/utils.py", line 80, in dist_info
    import distro
ModuleNotFoundError: No module named 'distro'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "./run.py", line 13, in <module>
    from modoboa_installer import package
  File "/root/modoboa-installer/modoboa_installer/package.py", line 121, in <module>
    backend = get_backend()
  File "/root/modoboa-installer/modoboa_installer/package.py", line 109, in get_backend
    distname = utils.dist_name()
  File "/root/modoboa-installer/modoboa_installer/utils.py", line 94, in dist_name
    name, version, _id = dist_info()
  File "/root/modoboa-installer/modoboa_installer/utils.py", line 85, in dist_info
    return platform.linux_distribution()
AttributeError: module 'platform' has no attribute 'linux_distribution'
  Explain the behavior you're seeing that you think is a bug, and explain how you
  think things should behave instead.

-->
Originally created by @jamielsharief on GitHub (Jun 25, 2021). Original GitHub issue: https://github.com/modoboa/modoboa/issues/2285 I am using **Ubuntu 20.04**, and after following the[ installation instructions,](https://modoboa.readthedocs.io/en/latest/installation.html) installation just did not work. ``` $ sudo ./run.py mail.mydomain.com Traceback (most recent call last): File "/root/modoboa-installer/modoboa_installer/utils.py", line 80, in dist_info import distro ModuleNotFoundError: No module named 'distro' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "./run.py", line 13, in <module> from modoboa_installer import package File "/root/modoboa-installer/modoboa_installer/package.py", line 121, in <module> backend = get_backend() File "/root/modoboa-installer/modoboa_installer/package.py", line 109, in get_backend distname = utils.dist_name() File "/root/modoboa-installer/modoboa_installer/utils.py", line 94, in dist_name name, version, _id = dist_info() File "/root/modoboa-installer/modoboa_installer/utils.py", line 85, in dist_info return platform.linux_distribution() AttributeError: module 'platform' has no attribute 'linux_distribution' Explain the behavior you're seeing that you think is a bug, and explain how you think things should behave instead. --> ```
kerem closed this issue 2026-02-27 11:17:50 +03:00
Author
Owner

@jamielsharief commented on GitHub (Jun 25, 2021):

Ran this and now it works.

$ sudo apt install python3-distro
<!-- gh-comment-id:868463733 --> @jamielsharief commented on GitHub (Jun 25, 2021): Ran this and now it works. ``` $ sudo apt install python3-distro ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/modoboa-modoboa#1564
No description provided.