Installed in Linux Mint, but Error: cannot import name 'dir_util'

Here's what I get when I start OpenLP in the terminal:

Traceback (most recent call last):

 File "/usr/bin/openlp", line 27, in <module>

   from openlp.core.common import is_win, is_macosx

 File "/usr/share/openlp/openlp/__init__.py", line 26, in <module>

   from openlp import core, plugins

 File "/usr/share/openlp/openlp/core/__init__.py", line 43, in <module>

   from openlp.core.ui.mainwindow import MainWindow

 File "/usr/share/openlp/openlp/core/ui/mainwindow.py", line 29, in <module>

   from distutils import dir_util

ImportError: cannot import name 'dir_util'

Comments

  • Hi,

    unfortunately same here.

    Linux Mint 19.3, Linux 5.4.0-80-generic

    :~$ openlp

    Traceback (most recent call last):

     File "/usr/bin/openlp", line 27, in <module>

       from openlp.core.common import is_win, is_macosx

     File "/usr/share/openlp/openlp/__init__.py", line 26, in <module>

       from openlp import core, plugins

     File "/usr/share/openlp/openlp/core/__init__.py", line 43, in <module>

       from openlp.core.ui.mainwindow import MainWindow

     File "/usr/share/openlp/openlp/core/ui/mainwindow.py", line 29, in <module>

       from distutils import dir_util

    ImportError: cannot import name 'dir_util'

    Error in sys.excepthook:

    Traceback (most recent call last):

     File "/usr/lib/python3/dist-packages/apport_python_hook.py", line 154, in apport_excepthook

       os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0o640), 'wb') as f:

    FileNotFoundError: [Errno 2] No such file or directory: '/var/crash/_usr_share_openlp_openlp.py.1000.crash'


    Original exception was:

    Traceback (most recent call last):

     File "/usr/bin/openlp", line 27, in <module>

       from openlp.core.common import is_win, is_macosx

     File "/usr/share/openlp/openlp/__init__.py", line 26, in <module>

       from openlp import core, plugins

     File "/usr/share/openlp/openlp/core/__init__.py", line 43, in <module>

       from openlp.core.ui.mainwindow import MainWindow

     File "/usr/share/openlp/openlp/core/ui/mainwindow.py", line 29, in <module>

       from distutils import dir_util

    ImportError: cannot import name 'dir_util'

  • Hi again,

    I found an answer, it was on this forum.

    To make OpenLP run on Mint we must have: python3-distutils


    sudo apt install python3-distutils


    All is working fine after that...

  • Thanks for the solution!

    I got involved in a new hard drive install, and I tried to install the l latest Mint. It insisted on using UEFI and wanted to kill my BIOS drive, so I bailed out. I installed MX Linux instead, and uOpenLP is working fine.

    Lane

  • edited September 2021

    Thanks for this. Had exactly the same issue installing and running OpenLP 2.4.6 via Software Manager on Linux Mint 20.2

    Nothing was said that you needed python3-distutils but once I followed the advice from @dzidek23 here and did

    sudo apt install python3-distutils

    all ran fine.

    Great

  • We've removed the dependency on the python3-distutils package, so this should no longer be an issue.

  • I just tried to install on Ubuntu 22.04.01 using the apt repository. It installed 2.4.6-1, and would not launch until I also installed the python3-distutils package.

Sign In or Register to comment.