Root and argparse Python module


I am using ROOT 6.04/14 in OSX 10.11.5. I attached a minimal (its really short) example of the problem I have with my code.

When I do:

./ -h

The module gets loaded, which imports (and therefore runs), which uses ROOT to make a histogram. Then I use the argparse module. If I comment the line that imports and write it down, after pars_args is called I get the right output. If I import this module at the beginning, before pars_args is called I get the help for root.exe and the computer claims that the executable is not but /usr/bin/python.

I can bypass this easily by importing after I call pars_args but I thought I should let you know this in case someone else gets this type of problem. Also, is there a more elegant way to bypass this?

Cheers. (31 Bytes) (63 Bytes) (281 Bytes)


see this interesting post about the behaviour you are describing: PyROOT hijacks --help



That totally makes sense.