error with 'import' command

Asked by Bouaziz Hamza

Good morning ma5 team

i have a problem with the command 'import', it returns error even with zlib installed and when trying to import .lhe files.

MA5: *************************************************************
MA5: * *
MA5: * W E L C O M E to M A D A N A L Y S I S 5 *
MA5: * ______ ______ *
MA5: * /'\_/`\/\ __ \/\ ___\ *
MA5: * /\ \ \ \_\ \ \ \__/ *
MA5: * \ \ \__\ \ \ __ \ \___``\ *
MA5: * \ \ \_/\ \ \ \/\ \/\ \_\ \ *
MA5: * \ \_\\ \_\ \_\ \_\ \____/ *
MA5: * \/_/ \/_/\/_/\/_/\/___/ *
MA5: * *
MA5: * MA5 release : 1.8.59 2020/11/02 *
MA5: * *
MA5: * Comput. Phys. Commun. 184 (2013) 222-256 *
MA5: * Eur. Phys. J. C74 (2014) 3103 *
MA5: * *
MA5: * The MadAnalysis Development Team - Please visit us at *
MA5: * https://launchpad.net/madanalysis5 *
MA5: * *
MA5: * Type 'help' for in-line help. *
MA5: * *
MA5: *************************************************************
MA5: Platform: Linux 5.8.0-41-generic [Linux mode]
MA5: Reading user settings ...
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 [OK]
MA5: - Root [OK]
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 [DISABLED]
MA5: - PAD [DISABLED]
MA5: - PADForMA5tune [DISABLED]
MA5: - PADForSFS [DISABLED]
MA5: - pyhf [DISABLED]
MA5: Checking optional packages devoted to histogramming:
MA5: - Root [OK]
MA5: - Matplotlib [DISABLED]
MA5: - gnuplot [OK]
MA5: - pdflatex [OK]
MA5: - latex [OK]
MA5: Package used for graphical rendering: Root
MA5: *************************************************************
MA5: Particle labels exported from madanalysis/input/particles_name_default.txt
MA5: => 87 particles successfully exported.
MA5: Multiparticle labels exported from madanalysis/input/multiparticles_default.txt
MA5: => Creation of the label 'invisible' (-> missing energy).
MA5: => Creation of the label 'hadronic' (-> jet energy).
MA5: => 8 multiparticles successfully exported.
ma5>import samples/zz.lhe.gz
MA5-ERROR: The dataset 'samples/zz.lhe.gz' has not been found or has a unsupported format.
ma5>import samples/zz.lhe
MA5-ERROR: The dataset 'samples/zz.lhe' has not been found or has a unsupported format.
ma5>import zz.lhe.gz
MA5-ERROR: The dataset 'zz.lhe.gz' has not been found or has a unsupported format.
ma5>import zz.lhe
MA5-ERROR: The dataset 'zz.lhe' has not been found or has a unsupported format.
ma5>

any help is appreciated.

hamza.

Question information

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

Hi Hamza

Unfortunately, I can not reproduce your problem. You need to give the relative (or full) path of the file to import command for it to be able to find it. As a test could you run the following command in Ma5-command-line

```
!ls ./*
```

this will show you the list of the folders that you can see from your directory. Using this information you can write the relative paths for your samples which I believe should be either in ```~/madanalysis5``` or in ```~/madanalysis5/samples``` directory.

Cheers
Jack

Revision history for this message
Bouaziz Hamza (b-hamza) said :
#2

Thanks Jack Y. Araz, that solved my question.

Revision history for this message
Bouaziz Hamza (b-hamza) said :
#3

Hello again.

This is just to show what i did to fix my issue.

when typing in ma5 prompt : "shell ls" or "!ls ./" it showed that my work directory is at /home folder (don't know how it got there.)
that means that i had to import samples using the command:

import /home/hamza/Downloads/madanalysis5/samples/*.lhe.gz

which is very long and tiring, so what i did was set the work directory to madanalysis5 folder by using

set.maincurrentdir = /home/....../madanalysis5

such that import command works without errors just like in the ma5 paper/tutos.

hope this helps.

cheers.

Hamza.

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

Hi Hamza,

I am happy to read that you have found a solution. This issue is nevertheless weird and it is the first time I read about it. Maybe it is related to the folder from which you start the code, or to your operating system. Anyways, the problem is fixed.

Regards,

Benjamin

Revision history for this message
Bouaziz Hamza (b-hamza) said :
#5

Hello Benjamin

Thank you for your reply.
Just one more question.

As i found out, yes the issue is related to the directory you launch you ma5 from.

Is there a way to set the working directory once for all no matter where ma5 is launched from?

Hamza.

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

Hi Hamza,

You should just make sure to be in the directory where the program has been installed when you start it.

Regards,

Benjamin

> On 9 Feb 2021, at 09:50 , Bouaziz Hamza <email address hidden> wrote:
>
> Question #695341 on MadAnalysis 5 changed:
> https://answers.launchpad.net/madanalysis5/+question/695341
>
> Bouaziz Hamza posted a new comment:
> Hello Benjamin
>
> Thank you for your reply.
> Just one more question.
>
> As i found out, yes the issue is related to the directory you launch you
> ma5 from.
>
> Is there a way to set the working directory once for all no matter where
> ma5 is launched from?
>
> Hamza.
>
> --
> You received this question notification because you are an answer
> contact for MadAnalysis 5.