PyROOT terminal problems

Hi everyone,

I have recently installed ROOT version 6.06 on mac using macports. I am running python version 2.7.11 which I also installed using macports. ROOT works just fine from the ROOT prompt, however, when I try to use PyROOT I run into some strange behaviour from the terminal.

Essentially once I’ve imported ROOT into python (which doesn’t give any error) the backspace key and arrow keys no longer work as expected. Pressing the backspace key seems to delete characters as expected but this is not reflected at the terminal until after the enter key is pressed.

For example if I type “1+1” and then press the backspace key the text displayed at the terminal does not change and the cursor does not appear to move, however, if I then press enter then I get the following error as you might expect:

File "<stdin>", line 1 1+ ^ SyntaxError: invalid syntax

If I again type “1+1” but this time press the left arrow key nothing seems to happen on screen (the cursor does not move) but if I then hit backspace the display changes to “1+11” and pressing enter simply leads to an output of “11”. Similarly pressing the up arrow multiple times after a set of commands appears to add each one to current line without deleting the previous one but hitting enter only executes the most recent one.

What seems to be happening is that the terminal still understands the input from the keyboard as expected but something is going wrong with the way it displays these changes on the screen.

These aren’t problems I’ve encountered before on this machine (or any other) and they don’t occur when importing any other module (e.g. numpy, matplotlib etc.) into python. So far I’ve tried reinstalling ROOT6, updating python, switching to ROOT5 and using a different terminal (iTerm rather than the default osx terminal) but I still run into the exact same problem.

Sorry if I haven’t explained the problem clearly enough but if anyone has any ideas as to what might cause this sort of behaviour or how to troubleshoot it I’d be very glad to hear them.


could you try out our binaries and see if the problem is reproduced?


So I installed root from the binary as you suggest and I do not get the same problem. Although I can now only import root from the system version of python which is a little out of date (2.7.5).

So would it be correct to assume that using our binaries and removing the macports root represents a solution for you?


Yes, although it does leave me with a bit of extra work to do to reconfigure python etc. I also would have been interested to find out what was causing such a peculiar problem but I guess these things just happen from time to time.


thanks for trying this out.
I would exclude an intermittent problem on the root side and rather tend to classify this as a misconfiguration on your side - nothing serious though: as you say these things happen from time to time :wink:


I am getting the same problem as the original poster. I am also using ROOT 6.06 from MacPorts (recently updated) and python 2.7.11 also from MacPorts. It occurs both in the basic python interpreter and in IPython.

As far as I know I did not change my configuration since the last time it worked, other than doing MacPorts updates. It only occurs with the ROOT module, not with any other python modules that I tested (stdlib ones and 3rd party).

For me “don’t use macports” is not a satisfactory solution, as I also use other macports-provided python libraries that work fine.


My MacPorts installation still has 6.06/00, /02, and /03 available, and they all show the same behaviour.

I removed ROOT 6 and replaced it with ROOT 5.34/36 and this one works fine.