question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Ubuntu 20.04: No module named 'distro'

See original GitHub issue

On a fresh ubuntu 20.04 install the run.py fails with missing module distro. You should install python3-distro first: apt install python3-distro

Impacted versions

  • Distribution: Ubuntu
  • Codename: Focal

Steps to reproduce

fresh install, than run:

python3 run.py --stop-after-configfile-check domain.hu

Full trace using --debug option or current behaviour

Traceback (most recent call last):
  File "/usr/src/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 "/usr/src/modoboa-installer/modoboa_installer/package.py", line 105, in <module>
    backend = get_backend()
  File "/usr/src/modoboa-installer/modoboa_installer/package.py", line 93, in get_backend
    distname = utils.dist_name()
  File "/usr/src/modoboa-installer/modoboa_installer/utils.py", line 94, in dist_name
    name, version, _id = dist_info()
  File "/usr/src/modoboa-installer/modoboa_installer/utils.py", line 85, in dist_info
    return platform.linux_distribution()
AttributeError: module 'platform' has no attribute 'linux_distribution'

Expected behavior

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
maxccocommented, Oct 7, 2020

Hello

On new install of ubuntu server 20.04 everything works as expected. I checked and python3-distro is present at install

What was the setting you use for ubuntu install ?

0reactions
tonioocommented, Sep 22, 2021

this issue should be fixed now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ModuleNotFoundError: No module named 'distro'
For Debian/Ubuntu users, when you have the error: command not found: pip3. you have to use apt : apt install python3-distro.
Read more >
how to solve "No module named 'distro_info'" on updating
sudo apt-get install --reinstall python3-distro-info worked for me.
Read more >
ModuleNotFoundError: No module named 'distro-tutorial'
Hi, My Python program is throwing following error: ModuleNotFoundError: No module named 'distro-tutorial' How to remove the Mo.
Read more >
A brand new website interface for an even better experience!
Ubuntu 20.04 : No module named 'distro'
Read more >
Solved: ModuleNotFoundError: No module named 'skbuild'
Please note that in my case I am using Ubuntu 20.04 LTS System with Python3 installed. This could be different for you. You...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found