ImportError: cannot import name 'dir_util' from 'distutils'(/usr/lib/python3.8/distutils/__init__.py)

Asked by Halley_X

When I install Madgraph, there is a importError: cannot import name 'dir_util' from 'distutils'(/usr/lib/python3.8/distutils/__init__.py)
Is this about my python's version? My Ubuntu's version is 20.04, python2 maybe not allowed in this version.

Question information

Language:
English Edit question
Status:
Solved
For:
MadGraph5_aMC@NLO Edit question
Assignee:
No assignee Edit question
Solved by:
Olivier Mattelaer
Solved:
Last query:
Last reply:
Revision history for this message
Best Olivier Mattelaer (olivier-mattelaer) said :
#1

Hi,

This is technically an issue of your python3 installation.
did you try
apt-get install python3-distutils

Otherwise you can use that patch:
https://bazaar.launchpad.net/~mg5core1/mg5amcnlo/2.8.1/revision/291 <https://bazaar.launchpad.net/~mg5core1/mg5amcnlo/2.8.1/revision/291>
which put in place a work around to not rely on that part of python code.

Cheers,

Olivier

> On 13 Sep 2020, at 08:25, XiongHanying <email address hidden> wrote:
>
> New question #692882 on MadGraph5_aMC@NLO:
> https://answers.launchpad.net/mg5amcnlo/+question/692882
>
> When I install Madgraph, there is a importError: cannot import name 'dir_util' from 'distutils'(/usr/lib/python3.8/distutils/__init__.py)
> Is this about my python's version? My Ubuntu's version is 20.04, python2 maybe not allowed in this version.
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Halley_X (neuromance) said :
#2

Thanks Olivier Mattelaer, that solved my question.