Error while opening MA5 in the expert mode

Asked by Harshal Kulkarni

Hi,
    I want to run MA5 in the expert mode, especially to extract the data to a csv file. However, while doing so, I encountered the following error:

MA5: Creating folder '/mnt/c/Users/Harshal.Kulkarni/MG5_aMC_v2_9_4/HEPTools/madanalysis5/madanalysis5/MyAnalysis'...
MA5: Copying required 'SampleAnalyzer' source files...
MA5: Please enter a name for your analysis
Answer: MyAnalysis
MA5: Writing an empty analysis...
sh: 1: python: not found
Traceback (most recent call last):
  File "./bin/ma5", line 69, in <module>
    madanalysis.core.launcher.LaunchMA5(version, date, ma5dir)
  File "/mnt/c/Users/Harshal.Kulkarni/MG5_aMC_v2_9_4/HEPTools/madanalysis5/madanalysis5/madanalysis/core/launcher.py", line 430, in LaunchMA5
    repeat = MainSession(mode,arglist,ma5dir,version,date)
  File "/mnt/c/Users/Harshal.Kulkarni/MG5_aMC_v2_9_4/HEPTools/madanalysis5/madanalysis5/madanalysis/core/launcher.py", line 306, in MainSession
    if not expert.Copy(dirname,config=config_file):
  File "/mnt/c/Users/Harshal.Kulkarni/MG5_aMC_v2_9_4/HEPTools/madanalysis5/madanalysis5/madanalysis/core/expert_mode.py", line 133, in Copy
    file = open(self.path+"/Build/SampleAnalyzer/User/Analyzer/analysisList.h")
FileNotFoundError: [Errno 2] No such file or directory: '/mnt/c/Users/Harshal.Kulkarni/MG5_aMC_v2_9_4/HEPTools/madanalysis5/madanalysis5/MyAnalysis/Build/SampleAnalyzer/User/Analyzer/analysisList.h'

Can you please help and let me know how to resolve this error? It seems that analysisList.h file is not being created in the folder. (I am using python3, but I get similar errors while using python2 as well)

Thank you,
Harshal

Question information

Language:
English Edit question
Status:
Solved
For:
MadAnalysis 5 Edit question
Assignee:
No assignee Edit question
Solved by:
Benjamin Fuks
Solved:
Last query:
Last reply:
Revision history for this message
Jack Y. Araz (jackaraz) said :
#1

Hi Harshal

Could you please write which commands you are typing before getting this error and how are you initiating ma5? Also please make sure that you are using the latest version of v1.9_beta.

cheers


Jack Y. Araz

> On Aug 2, 2021, at 3:10 PM, Harshal Kulkarni <email address hidden> wrote:
>
> Harshal

Revision history for this message
Harshal Kulkarni (hck18ms056) said :
#2

This is the version of MA5 I am using (in python 3.8) : MA5 release : 1.9.21 2021/05/11
These are the commands I have typed:
python3 ./bin/ma5 -e

Welcome to the expert mode of MadAnalysis
MA5: Please enter a folder name for creating an empty SampleAnalyzer job
Answer: MyAnalysis
MA5-WARNING: Are you sure to remove the directory called '/mnt/c/Users/Harshal.Kulkarni/MG5_aMC_v2_9_4/HEPTools/madanalysis5/madanalysis5/MyAnalysis' ? (Y/N)
Answer: Y
MA5: Creating folder '/mnt/c/Users/Harshal.Kulkarni/MG5_aMC_v2_9_4/HEPTools/madanalysis5/madanalysis5/MyAnalysis'...
MA5: Copying required 'SampleAnalyzer' source files...
MA5: Please enter a name for your analysis
Answer: MyAnalysis
MA5: Writing an empty analysis...

Revision history for this message
Jack Y. Araz (jackaraz) said :
#3

Hi Harshal

Could you please try it with the latest version its v1.9.32 released on 2021/07/16. Also you don't need to type python3 to execute, ma5 is already an executable. Note that I can not reproduce your error on my machine.

Cheers


Jack Y. Araz

> On Aug 2, 2021, at 4:45 PM, Harshal Kulkarni <email address hidden> wrote:
>
> [EXTERNAL EMAIL]
>
> Question #698216 on MadAnalysis 5 changed:
> https://answers.launchpad.net/madanalysis5/+question/698216
>
> Harshal Kulkarni posted a new comment:
> This is the version of MA5 I am using (in python 3.8) : MA5 release : 1.9.21 2021/05/11
> These are the commands I have typed:
> python3 ./bin/ma5 -e
>
> Welcome to the expert mode of MadAnalysis
> MA5: Please enter a folder name for creating an empty SampleAnalyzer job
> Answer: MyAnalysis
> MA5-WARNING: Are you sure to remove the directory called '/mnt/c/Users/Harshal.Kulkarni/MG5_aMC_v2_9_4/HEPTools/madanalysis5/madanalysis5/MyAnalysis' ? (Y/N)
> Answer: Y
> MA5: Creating folder '/mnt/c/Users/Harshal.Kulkarni/MG5_aMC_v2_9_4/HEPTools/madanalysis5/madanalysis5/MyAnalysis'...
> MA5: Copying required 'SampleAnalyzer' source files...
> MA5: Please enter a name for your analysis
> Answer: MyAnalysis
> MA5: Writing an empty analysis...
>
> --
> You received this question notification because you are an answer
> contact for MadAnalysis 5.

Revision history for this message
Harshal Kulkarni (hck18ms056) said :
#4

Hi,
Can you please provide the link to download this latest version? I am unable to find it on the MA5 website.
Also, ROOT is not essential for working in the expert mode, right?

Thanks,
Harshal

Revision history for this message
Jack Y. Araz (jackaraz) said :
#5

Hi Harshal

You can find the latest version here: https://code.launchpad.net/~ma5dev/madanalysis5/v1.9_beta <https://code.launchpad.net/~ma5dev/madanalysis5/v1.9_beta>

No, you don't need root, as long as you don't want to read a root file.

Cheers


Jack Y. Araz

> On Aug 2, 2021, at 7:20 PM, Harshal Kulkarni <email address hidden> wrote:
>
> [EXTERNAL EMAIL]
>
> Question #698216 on MadAnalysis 5 changed:
> https://answers.launchpad.net/madanalysis5/+question/698216
>
> Harshal Kulkarni posted a new comment:
> Hi,
> Can you please provide the link to download this latest version? I am unable to find it on the MA5 website.
> Also, ROOT is not essential for working in the expert mode, right?
>
> Thanks,
> Harshal
>
> --
> You received this question notification because you are an answer
> contact for MadAnalysis 5.

Revision history for this message
Harshal Kulkarni (hck18ms056) said :
#6

Hi,
     Thanks for the link. Despite using ma5 version 1.9.32, I am getting exactly the same error:

Welcome to the expert mode of MadAnalysis
MA5: Please enter a folder name for creating an empty SampleAnalyzer job
Answer: MyAnalysis
MA5: Creating folder '/mnt/c/Users/Harshal.Kulkarni/MG5_aMC_v2_9_4/HEPTools/madanalysis5/madanalysis5/v1.9_beta/MyAnalysis'...
MA5: Copying required 'SampleAnalyzer' source files...
MA5: Please enter a name for your analysis
Answer: MyAnalysis
MA5: Writing an empty analysis...
sh: 1: python: not found
Traceback (most recent call last):
  File "./bin/ma5", line 77, in <module>
    madanalysis.core.launcher.LaunchMA5(version, date, ma5dir)
  File "/mnt/c/Users/Harshal.Kulkarni/MG5_aMC_v2_9_4/HEPTools/madanalysis5/madanalysis5/v1.9_beta/madanalysis/core/launcher.py", line 430, in LaunchMA5
    repeat = MainSession(mode,arglist,ma5dir,version,date)
  File "/mnt/c/Users/Harshal.Kulkarni/MG5_aMC_v2_9_4/HEPTools/madanalysis5/madanalysis5/v1.9_beta/madanalysis/core/launcher.py", line 306, in MainSession
    if not expert.Copy(dirname,config=config_file):
  File "/mnt/c/Users/Harshal.Kulkarni/MG5_aMC_v2_9_4/HEPTools/madanalysis5/madanalysis5/v1.9_beta/madanalysis/core/expert_mode.py", line 133, in Copy
    file = open(self.path+"/Build/SampleAnalyzer/User/Analyzer/analysisList.h")
FileNotFoundError: [Errno 2] No such file or directory: '/mnt/c/Users/Harshal.Kulkarni/MG5_aMC_v2_9_4/HEPTools/madanalysis5/madanalysis5/v1.9_beta/MyAnalysis/Build/SampleAnalyzer/User/Analyzer/analysisList.h'

I am not sure why this is happening. Can you please help?

Thanks,
Harshal

Revision history for this message
Benjamin Fuks (fuks) said :
#7

Hi Harshal,

This is really odd. Can you please try to replace "python" with "python3" in the first line of the file bin/ma5? This may fix the problem as it seems that the "python" executable is not available (but the "python3" one is available instead).

Cheers,

Benjamin

Revision history for this message
Harshal Kulkarni (hck18ms056) said :
#8

Hi,
     Thanks for your reply. The output does not change despite using "python3" instead of "python". I am still getting the same error. It says that some file is missing. I am not sure how to fix that. (Also I am not sure why it says sh:1:python not found). These are all the libraries in MA5 (and it says python [OK]):

MA5: Checking mandatory packages:
MA5: - Python [OK]
MA5: - GNU GCC g++ [OK]
MA5: - GNU Make [OK]
MA5: Checking optional packages devoted to data processing:
MA5: - Zlib [OK]
MA5: - FastJet [DISABLED]
MA5-ERROR: command root-config is not found
MA5: - Root [DISABLED]
MA5: - Delphes [DISABLED]
MA5: - Delphes-MA5tune [DISABLED]
MA5: Checking the MadAnalysis 5 core library:
MA5: => MadAnalysis libraries found.
MA5: => MadAnalysis test program works.
MA5: Reading user settings ...
MA5: Checking optional packages devoted to reinterpretation:
MA5: - SciPy [OK]
MA5: - PAD [DISABLED]
MA5: - PADForMA5tune [DISABLED]
MA5: - PADForSFS [DISABLED]
MA5: - pyhf [DISABLED]
MA5: Checking optional packages devoted to histogramming:
MA5: - Root [DISABLED]
MA5: - Matplotlib [OK]
MA5-WARNING: gnuplot is not found. Please install it if you would like to use gnuplot
MA5: - gnuplot [FAILURE]
MA5-WARNING: gnuplot disabled. Plots in gnuplot format file will not be produced.
MA5: - pdflatex [OK]
MA5: - latex [OK]
MA5: Package used for graphical rendering: Matplotlib

Can you please help me here?

Thanks,
Harshal

Revision history for this message
Benjamin Fuks (fuks) said :
#9

Can you please run the code in debug mode and dump the entire log. Thanks in advance.

Regards,

Benjamin

> On 23 Aug 2021, at 14:30, Harshal Kulkarni <email address hidden> wrote:
>
> Question #698216 on MadAnalysis 5 changed:
> https://answers.launchpad.net/madanalysis5/+question/698216
>
> Harshal Kulkarni posted a new comment:
> Hi,
> Thanks for your reply. The output does not change despite using "python3" instead of "python". I am still getting the same error. It says that some file is missing. I am not sure how to fix that. (Also I am not sure why it says sh:1:python not found). These are all the libraries in MA5 (and it says python [OK]):
>
> MA5: Checking mandatory packages:
> MA5: - Python [OK]
> MA5: - GNU GCC g++ [OK]
> MA5: - GNU Make [OK]
> MA5: Checking optional packages devoted to data processing:
> MA5: - Zlib [OK]
> MA5: - FastJet [DISABLED]
> MA5-ERROR: command root-config is not found
> MA5: - Root [DISABLED]
> MA5: - Delphes [DISABLED]
> MA5: - Delphes-MA5tune [DISABLED]
> MA5: Checking the MadAnalysis 5 core library:
> MA5: => MadAnalysis libraries found.
> MA5: => MadAnalysis test program works.
> MA5: Reading user settings ...
> MA5: Checking optional packages devoted to reinterpretation:
> MA5: - SciPy [OK]
> MA5: - PAD [DISABLED]
> MA5: - PADForMA5tune [DISABLED]
> MA5: - PADForSFS [DISABLED]
> MA5: - pyhf [DISABLED]
> MA5: Checking optional packages devoted to histogramming:
> MA5: - Root [DISABLED]
> MA5: - Matplotlib [OK]
> MA5-WARNING: gnuplot is not found. Please install it if you would like to use gnuplot
> MA5: - gnuplot [FAILURE]
> MA5-WARNING: gnuplot disabled. Plots in gnuplot format file will not be produced.
> MA5: - pdflatex [OK]
> MA5: - latex [OK]
> MA5: Package used for graphical rendering: Matplotlib
>
> Can you please help me here?
>
> Thanks,
> Harshal
>
> --
> You received this question notification because you are an answer
> contact for MadAnalysis 5.

Revision history for this message
Harshal Kulkarni (hck18ms056) said :
#10

This is the output I am getting after running in the debug mode:

MA5-DEBUG:
MA5-DEBUG: DEBUG MODE ACTIVATED
MA5-DEBUG:
MA5: Platform: Linux 4.4.0-19041-Microsoft [Linux mode]
MA5-DEBUG:
MA5-DEBUG: Machine - Cross platform information
MA5-DEBUG: Machine type: x86_64
MA5-DEBUG: Processor name: x86_64
MA5-DEBUG: Platform: Linux-4.4.0-19041-Microsoft-x86_64-with-glibc2.29
MA5-DEBUG: Platform release: 4.4.0-19041-Microsoft
MA5-DEBUG: System: Linux
MA5-DEBUG: Node: LAPTOP-LKPJJ7UF
MA5-DEBUG: Number of cores: 8
MA5-DEBUG:
MA5-DEBUG: Machine - OS-specific information
MA5-DEBUG: Java version: ('', '', ('', '', ''), ('', '', ''))
MA5-DEBUG: Windows version: ('', '', '', '')
MA5-DEBUG: Mac Os version: ('', ('', '', ''), '')
MA5-DEBUG: Unix distribution: Linux-4.4.0-19041-Microsoft-x86_64-with-glibc2.29
MA5-DEBUG:
MA5: Reading user settings ...
MA5-DEBUG: Opening the file: /mnt/c/Users/Harshal.Kulkarni/MG5_aMC_v2_9_4/HEPTools/madanalysis5/madanalysis5/v1.9_beta/madanalysis/input/installation_options.dat
MA5-DEBUG: Lines to interpret:
MA5-DEBUG: Closing the file: /mnt/c/Users/Harshal.Kulkarni/MG5_aMC_v2_9_4/HEPTools/madanalysis5/madanalysis5/v1.9_beta/madanalysis/input/installation_options.dat
MA5-DEBUG:
MA5-DEBUG: User
MA5-DEBUG: User name: harshal
MA5-DEBUG: User ID: 1000
MA5-DEBUG: Expanding folder ~/: /home/harshal/
MA5-DEBUG: Variable $USER: harshal
MA5-DEBUG: Variable $USERNAME:
MA5-DEBUG: Variable $LNAME:
MA5-DEBUG: Variable $LOGNAME: harshal
MA5-DEBUG: Variable $HOME: /home/harshal
MA5-DEBUG: Variable $HOMEDRIVE:
MA5-DEBUG: Variable $posix:
MA5-DEBUG: Variable $HOMEPATH:
MA5-DEBUG:
MA5-DEBUG: Web access
MA5-DEBUG: enable
MA5-DEBUG:
MA5-DEBUG: Temporary folder
MA5-DEBUG: Variable $TMPDIR:
MA5-DEBUG: Variable $TMP:
MA5-DEBUG: Variable $TEMP:
MA5-DEBUG: Check if the folder /tmp/harshal exists ...
MA5-DEBUG: -> found
MA5-DEBUG: temporary folder will be used for MA5: /tmp/harshal
MA5-DEBUG:
MA5-DEBUG: Download dir
MA5-DEBUG: Check if the folder /tmp/harshal/MA5_downloads exists ...
MA5-DEBUG: -> found
MA5-DEBUG: download folder will be used for MA5: /tmp/harshal/MA5_downloads
MA5-DEBUG:
MA5-DEBUG: Text editor
MA5-DEBUG: Look for the global variable $EDITOR ...
MA5-DEBUG: -> variable not found. VI editor is set by default.
MA5-DEBUG:
MA5: Checking mandatory packages:
MA5-DEBUG: ------------------------------------------------------
MA5-DEBUG: Detect package python
MA5-DEBUG: Try to detect automatically the package ...
MA5-DEBUG: Extract more informations related to the package ...
MA5-DEBUG:
MA5-DEBUG: Python release: 3.8.5
MA5-DEBUG: Python build: ('default', 'May 27 2021 13:30:53')
MA5-DEBUG: Python compiler: GCC 9.3.0
MA5-DEBUG: Python prefix: /usr
MA5-DEBUG: Python executable used: /usr/bin/python3
MA5-DEBUG: sys.executable: /usr/bin/python3
MA5-ERROR: python compiler not found. Please install it before using MadAnalysis 5
MA5: - Python [FAILURE]
MA5-ERROR: This package is a mandatory package: MadAnalysis 5 can not run without it.

I am not sure why it says python compiler not found, this error did not appear when I was not using MA in the expert mode.

Revision history for this message
Best Benjamin Fuks (fuks) said :
#11

Hi,

The error means that the "python" command, when typed in a shell, does not work (because it does not exist on your system). Can you please create a symbolic link so that python = python3 (when typed in a shell)? This should fix all problems.

Cheers,

Benjamin

Revision history for this message
Harshal Kulkarni (hck18ms056) said :
#12

Hi, Thanks. That worked. But changing the environment again, for using the "make" command to build Madanalysisjob again gives a similar error. For example:

harshal@LAPTOP-LKPJJ7UF:/mnt/c/Users/Harshal.Kulkarni/MG5_aMC_v2_9_4/HEPTools/madanalysis5/madanalysis5/v1.9_beta/ma/Build$ /usr/bin/make
-e --------------------------------------------------------
-e Building MadAnalysis Job
-e --------------------------------------------------------
-e --------------------------------------------------------
-e Compilation
-e --------------------------------------------------------
g++ -Wall -O3 -fPIC -I/mnt/c/Users/Harshal.Kulkarni/MG5_aMC_v2_9_4/HEPTools/madanalysis5/madanalysis5/v1.9_beta/tools/ -I./ -o Main/main.o -c Main/main.cpp
make: g++: Command not found
make: *** [Makefile:99: Main/main.o] Error 127

Do I need to edit the Makefile generated by the Analysis by default?

P.S. - I am following the reference https://madanalysis.irmp.ucl.ac.be/raw-attachment/wiki/tutorials/ExpertMode-Tuto1.pdf

Revision history for this message
Benjamin Fuks (fuks) said :
#14

Hi,

That’s not a madanalysis problem, but instead a problem of your environment settings. If your C compiler cannot be found, the code will of course crash. Please update this.

Cheers,

Benjamin

> On 24 Aug 2021, at 12:20, Harshal Kulkarni <email address hidden> wrote:
>
> Question #698216 on MadAnalysis 5 changed:
> https://answers.launchpad.net/madanalysis5/+question/698216
>
> Status: Answered => Solved
>
> Harshal Kulkarni confirmed that the question is solved:
> Hi, Thanks. That worked. But changing the environment again, for using
> the "make" command to build Madanalysisjob again gives a similar error.
> For example:
>
> harshal@LAPTOP-LKPJJ7UF:/mnt/c/Users/Harshal.Kulkarni/MG5_aMC_v2_9_4/HEPTools/madanalysis5/madanalysis5/v1.9_beta/ma/Build$ /usr/bin/make
> -e --------------------------------------------------------
> -e Building MadAnalysis Job
> -e --------------------------------------------------------
> -e --------------------------------------------------------
> -e Compilation
> -e --------------------------------------------------------
> g++ -Wall -O3 -fPIC -I/mnt/c/Users/Harshal.Kulkarni/MG5_aMC_v2_9_4/HEPTools/madanalysis5/madanalysis5/v1.9_beta/tools/ -I./ -o Main/main.o -c Main/main.cpp
> make: g++: Command not found
> make: *** [Makefile:99: Main/main.o] Error 127
>
> Do I need to edit the Makefile generated by the Analysis by default?
>
> P.S. - I am following the reference
> https://madanalysis.irmp.ucl.ac.be/raw-
> attachment/wiki/tutorials/ExpertMode-Tuto1.pdf
>
> --
> You received this question notification because you are an answer
> contact for MadAnalysis 5.

Revision history for this message
Harshal Kulkarni (hck18ms056) said :
#15

Hi,
    Actually, there was a syntax error in the "setup.sh" file that was used to change the environment variables. Nevertheless, I corrected it and then it worked. Thanks for your help!