NameError : global name 'shutil' is not defined

Bug #1677494 reported by Songshaptak De
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MadGraph5_aMC@NLO
Fix Released
Undecided
Valentin Hirschi

Bug Description

generate_events run_01
Traceback (most recent call last):
  File "/home/saptak/packages/madgraph/madgraph/interface/extended_cmd.py", line 1414, in onecmd
    return self.onecmd_orig(line, **opt)
  File "/home/saptak/packages/madgraph/madgraph/interface/extended_cmd.py", line 1369, in onecmd_orig
    return func(arg, **opt)
  File "/home/saptak/packages/madgraph/madgraph/interface/madevent_interface.py", line 2125, in do_generate_events
    self.exec_cmd('shower --no_default', postcmd=False, printcmd=False)
  File "/home/saptak/packages/madgraph/madgraph/interface/extended_cmd.py", line 1441, in exec_cmd
    stop = Cmd.onecmd_orig(current_interface, line, **opt)
  File "/home/saptak/packages/madgraph/madgraph/interface/extended_cmd.py", line 1369, in onecmd_orig
    return func(arg, **opt)
  File "/home/saptak/packages/madgraph/madgraph/interface/madevent_interface.py", line 3441, in do_shower
    postcmd=False, printcmd=False)
  File "/home/saptak/packages/madgraph/madgraph/interface/extended_cmd.py", line 1441, in exec_cmd
    stop = Cmd.onecmd_orig(current_interface, line, **opt)
  File "/home/saptak/packages/madgraph/madgraph/interface/extended_cmd.py", line 1369, in onecmd_orig
    return func(arg, **opt)
  File "/home/saptak/packages/madgraph/madgraph/interface/madevent_interface.py", line 3981, in do_pythia8
    shutil.copy(pythia_main,parallelization_dir)
NameError: global name 'shutil' is not defined

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote : Re: [Bug 1677494] [NEW] NameError : global name 'shutil' is not defined
Download full text (3.5 KiB)

Hi,

Thanks for the information

Did you use 2.5.4?
This should be fixed in that version.

Cheers,

Olivier

> On 30 Mar 2017, at 09:18, Songshaptak De <email address hidden> wrote:
>
> Public bug reported:
>
> generate_events run_01
> Traceback (most recent call last):
> File "/home/saptak/packages/madgraph/madgraph/interface/extended_cmd.py", line 1414, in onecmd
> return self.onecmd_orig(line, **opt)
> File "/home/saptak/packages/madgraph/madgraph/interface/extended_cmd.py", line 1369, in onecmd_orig
> return func(arg, **opt)
> File "/home/saptak/packages/madgraph/madgraph/interface/madevent_interface.py", line 2125, in do_generate_events
> self.exec_cmd('shower --no_default', postcmd=False, printcmd=False)
> File "/home/saptak/packages/madgraph/madgraph/interface/extended_cmd.py", line 1441, in exec_cmd
> stop = Cmd.onecmd_orig(current_interface, line, **opt)
> File "/home/saptak/packages/madgraph/madgraph/interface/extended_cmd.py", line 1369, in onecmd_orig
> return func(arg, **opt)
> File "/home/saptak/packages/madgraph/madgraph/interface/madevent_interface.py", line 3441, in do_shower
> postcmd=False, printcmd=False)
> File "/home/saptak/packages/madgraph/madgraph/interface/extended_cmd.py", line 1441, in exec_cmd
> stop = Cmd.onecmd_orig(current_interface, line, **opt)
> File "/home/saptak/packages/madgraph/madgraph/interface/extended_cmd.py", line 1369, in onecmd_orig
> return func(arg, **opt)
> File "/home/saptak/packages/madgraph/madgraph/interface/madevent_interface.py", line 3981, in do_pythia8
> shutil.copy(pythia_main,parallelization_dir)
> NameError: global name 'shutil' is not defined
>
> ** Affects: mg5amcnlo
> Importance: Undecided
> Status: New
>
> --
> You received this bug notification because you are subscribed to
> MadGraph5_aMC@NLO.
> https://bugs.launchpad.net/bugs/1677494
>
> Title:
> NameError : global name 'shutil' is not defined
>
> Status in MadGraph5_aMC@NLO:
> New
>
> Bug description:
> generate_events run_01
> Traceback (most recent call last):
> File "/home/saptak/packages/madgraph/madgraph/interface/extended_cmd.py", line 1414, in onecmd
> return self.onecmd_orig(line, **opt)
> File "/home/saptak/packages/madgraph/madgraph/interface/extended_cmd.py", line 1369, in onecmd_orig
> return func(arg, **opt)
> File "/home/saptak/packages/madgraph/madgraph/interface/madevent_interface.py", line 2125, in do_generate_events
> self.exec_cmd('shower --no_default', postcmd=False, printcmd=False)
> File "/home/saptak/packages/madgraph/madgraph/interface/extended_cmd.py", line 1441, in exec_cmd
> stop = Cmd.onecmd_orig(current_interface, line, **opt)
> File "/home/saptak/packages/madgraph/madgraph/interface/extended_cmd.py", line 1369, in onecmd_orig
> return func(arg, **opt)
> File "/home/saptak/packages/madgraph/madgraph/interface/madevent_interface.py", line 3441, in do_shower
> postcmd=False, printcmd=False)
> File "/home/saptak/packages/madgraph/madgraph/interface/extended_cmd.py", line 1441, in exec_cmd
> stop = Cmd.onecmd_orig(current_interface, line, **opt)
> File "/home/saptak/packages/mad...

Read more...

Revision history for this message
Songshaptak De (maverick1691) wrote :

Thanks Olivier.

I was using the version 2.5.3. But, as you have said the bug is gone with the version 2.5.4. However, I am facing a new bug given as follows:

Command "generate_events run_01" interrupted with error:
InvalidCmd : Could not find cross-section and event number information in Pythia8 log

I am facing this bug when I am generating the SUSY process p p > b1 b1~, (b1 > b n1), (b1~ > b~ n1)

Cheers!

Revision history for this message
Olivier Mattelaer (olivier-mattelaer) wrote :

Weird, that is working nicely for me.

Maybe Valentin might help you on that.

Cheers,

Olivier

PS: Maybe it can be usefull if you can attach your pythia8 card.

Changed in mg5amcnlo:
assignee: nobody → Valentin Hirschi (valentin-hirschi)
Revision history for this message
Valentin Hirschi (valentin-hirschi) wrote :

Well, the problem comes from the fact that in your case, the Pythia8 log file resulting from the showering of your events did not contain the basic information that I expect to always be there.

In more technical terms, the parsing of this log files done in the function 'parse_PY8_log_file(' in madgraph/interface/madevent_interface.py failed and I decided to interrupt the run when this happens (because I think it should never happen if the showering went fine).

So please, attach here the Pythia8 log file that you should be able to find in your directory:

<PROC_OUTPUT>/Events/run_XXX/tag_YYY_Pythia8.log

(Please adapt XXX, YYY and the name of the exact of the pythia8 log (which I don't remember by heart) to your case).

Changed in mg5amcnlo:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.