installation problem with ubuntu 16.04

Asked by Emidio Gabrielli

Hi,

I tried to install madgraph last version, however when I execute ./bin/mg5_aMC I got an error at the end SyntaxError: invalid syntax. I have all updated software, Python 2.7.12, Python 3.5.2, See below the exit.

Thanks in advance for your help.

Best regards, Emidio Gabrielli

=================================================================================================

./bin/mg5_aMC
Traceback (most recent call last):
  File "./bin/mg5_aMC", line 148, in <module>
    import madgraph.interface.master_interface as interface
  File "/home/emidio/SOFTWARE/MadGraph5/MG5_aMC_v2_9_1_2/madgraph/interface/master_interface.py", line 44, in <module>
    import madgraph.interface.madgraph_interface as MGcmd
  File "/home/emidio/SOFTWARE/MadGraph5/MG5_aMC_v2_9_1_2/madgraph/interface/madgraph_interface.py", line 71, in <module>
    import madgraph.iolibs.export_cpp as export_cpp
  File "/home/emidio/SOFTWARE/MadGraph5/MG5_aMC_v2_9_1_2/madgraph/iolibs/export_cpp.py", line 43, in <module>
    from madgraph.iolibs.export_v4 import VirtualExporter
  File "/home/emidio/SOFTWARE/MadGraph5/MG5_aMC_v2_9_1_2/madgraph/iolibs/export_v4.py", line 53, in <module>
    import madgraph.various.diagram_symmetry as diagram_symmetry
  File "/home/emidio/SOFTWARE/MadGraph5/MG5_aMC_v2_9_1_2/madgraph/various/diagram_symmetry.py", line 51, in <module>
    import madgraph.various.process_checks as process_checks
  File "/home/emidio/SOFTWARE/MadGraph5/MG5_aMC_v2_9_1_2/madgraph/various/process_checks.py", line 71, in <module>
    from madgraph.interface.madevent_interface import MadLoopInitializer
  File "/home/emidio/SOFTWARE/MadGraph5/MG5_aMC_v2_9_1_2/madgraph/interface/madevent_interface.py", line 87, in <module>
    import madgraph.madevent.gen_ximprove as gen_ximprove
  File "/home/emidio/SOFTWARE/MadGraph5/MG5_aMC_v2_9_1_2/madgraph/madevent/gen_ximprove.py", line 61, in <module>
    import madgraph.madevent.hel_recycle as hel_recycle
  File "/home/emidio/SOFTWARE/MadGraph5/MG5_aMC_v2_9_1_2/madgraph/madevent/hel_recycle.py", line 90
    print_str += '\n\t'.join([f'{key} : {item}' for key, item in self.graph.items() ])
                                              ^
SyntaxError: invalid syntax

Question information

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

Hi,

MG5aMC requires python3.7 or newer
or you can also run a slower version of the code with python2.7
Some people claim that we are python3.6 compatible but we have never tested our code with that python version.
Python3.5 is certainly not supported.

In principle, the first code executed by MG5aMC is to check that you have a valid version of python.
But you are not the first one that have no issue with that file... (not sure how this is possible).

If you want to run python2.7
you can simply do it via
python2.7 ./bin/mg5_aMC

Otherwise you will need to install python3.7 or newer

Cheers,

Olivier

PS: Note that both python2.7 and python3.5 are python version which are not supported anymore

> On 2 Feb 2021, at 19:45, Emidio Gabrielli <email address hidden> wrote:
>
> New question #695335 on MadGraph5_aMC@NLO:
> https://answers.launchpad.net/mg5amcnlo/+question/695335
>
> Hi,
>
> I tried to install madgraph last version, however when I execute ./bin/mg5_aMC I got an error at the end SyntaxError: invalid syntax. I have all updated software, Python 2.7.12, Python 3.5.2, See below the exit.
>
> Thanks in advance for your help.
>
> Best regards, Emidio Gabrielli
>
>
> =================================================================================================
>
> ./bin/mg5_aMC
> Traceback (most recent call last):
> File "./bin/mg5_aMC", line 148, in <module>
> import madgraph.interface.master_interface as interface
> File "/home/emidio/SOFTWARE/MadGraph5/MG5_aMC_v2_9_1_2/madgraph/interface/master_interface.py", line 44, in <module>
> import madgraph.interface.madgraph_interface as MGcmd
> File "/home/emidio/SOFTWARE/MadGraph5/MG5_aMC_v2_9_1_2/madgraph/interface/madgraph_interface.py", line 71, in <module>
> import madgraph.iolibs.export_cpp as export_cpp
> File "/home/emidio/SOFTWARE/MadGraph5/MG5_aMC_v2_9_1_2/madgraph/iolibs/export_cpp.py", line 43, in <module>
> from madgraph.iolibs.export_v4 import VirtualExporter
> File "/home/emidio/SOFTWARE/MadGraph5/MG5_aMC_v2_9_1_2/madgraph/iolibs/export_v4.py", line 53, in <module>
> import madgraph.various.diagram_symmetry as diagram_symmetry
> File "/home/emidio/SOFTWARE/MadGraph5/MG5_aMC_v2_9_1_2/madgraph/various/diagram_symmetry.py", line 51, in <module>
> import madgraph.various.process_checks as process_checks
> File "/home/emidio/SOFTWARE/MadGraph5/MG5_aMC_v2_9_1_2/madgraph/various/process_checks.py", line 71, in <module>
> from madgraph.interface.madevent_interface import MadLoopInitializer
> File "/home/emidio/SOFTWARE/MadGraph5/MG5_aMC_v2_9_1_2/madgraph/interface/madevent_interface.py", line 87, in <module>
> import madgraph.madevent.gen_ximprove as gen_ximprove
> File "/home/emidio/SOFTWARE/MadGraph5/MG5_aMC_v2_9_1_2/madgraph/madevent/gen_ximprove.py", line 61, in <module>
> import madgraph.madevent.hel_recycle as hel_recycle
> File "/home/emidio/SOFTWARE/MadGraph5/MG5_aMC_v2_9_1_2/madgraph/madevent/hel_recycle.py", line 90
> print_str += '\n\t'.join([f'{key} : {item}' for key, item in self.graph.items() ])
> ^
> SyntaxError: invalid syntax
>
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.

Revision history for this message
Emidio Gabrielli (egabrielli) said :
#2

Dear Olivier,

Thanks for the prompt answer. Now it works! Actually I have installed python3.9 and runs great via python3.9 ./bin/mg5_aMC

as you said the problem was python3.5, which is the default if I do not specify the version.

Cheers, Emidio

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) said :
#3

Thanks,

and I have found why the check was not working... this will be fixed within 2.9.2

> On 2 Feb 2021, at 21:05, Emidio Gabrielli <email address hidden> wrote:
>
> Question #695335 on MadGraph5_aMC@NLO changed:
> https://answers.launchpad.net/mg5amcnlo/+question/695335
>
> Status: Answered => Solved
>
> Emidio Gabrielli confirmed that the question is solved:
> Dear Olivier,
>
> Thanks for the prompt answer. Now it works! Actually I have installed
> python3.9 and runs great via python3.9 ./bin/mg5_aMC
>
> as you said the problem was python3.5, which is the default if I do not
> specify the version.
>
> Cheers, Emidio
>
> --
> You received this question notification because you are an answer
> contact for MadGraph5_aMC@NLO.