PyROOT and Ubuntu 12.04

Hi,

I have installed the new Ubuntu 12.04 today, so I had to install ROOT again. Unfortunately I have now some problems with PyROOT. Does anybody know how I can install PyROOT on Ubuntu 12.04? At the moment I have the newest Version of ROOT installed and my C++ scripts work fine, but I prefer to use ROOT with Python. I hope that you can help me! Thanks! :slight_smile:

Maxwell

Hi,

the easiest is to build ROOT from source, but what does “some problems” mean? Note that there was this savannah report, which may be the same for you?

Cheers,
Wim

Hi Wim,

yes, I have built ROOT from source and I have used the first method which is presented in this help (http://root.cern.ch/drupal/content/installing-root-source). The problem is that I get “no module named ROOT” if I write “import ROOT” after writing “python” in the terminal. On Ubuntu 10.10 I was able to solve this problem, but now I don’t know what I have to do.

Thanks for help!

Cheers, Maxwell

Hi,

was python shown as being disabled after the configure run? Also, has PYTHONPATH been pointed to $ROOTSYS/lib?

Cheers,
Wim

Hm, how can I check it afterwards? In my bashrc-file is nothing with PYTHONPATH.

Hi,

simply do “echo $PYTHONPATH” or check sys.path in python.

Cheers,
Wim

Ok, than I get this: "/home/myname/root_v5.32.02/lib:"
But $PYTHONDIR doesn’t point to any directory.

Ok, I have solved the problem now! :slight_smile: I installed it again, but this time I typed “./configure --enable-python --prefix=/home/…/root_v5.32.01”. :stuck_out_tongue:

Configure ROOT adding “–enable-python --prefix=/Where/You/Want/To/Install/It --etcdir=/Where/You/Want/To/Install/It/etc/root” (if you do not set “etcdir”, it will default to “/etc/root”, regardless of what your “prefix” is).
Or … use my installation instructions (ROOT’s “etcdir” is automatically set to “${ROOTSYS}/etc”), adding just “–enable-python”: [url]Installing ROOT from Source

Hi Pepe Le Pew,

yes, I had to install ROOT again, but now without the --prefix-blabla. Now everything works and I have no errors. But one little problem is still there! :smiley:
If I run a python-script with a ROOT-canvas, the canvas is only for a second visible. I am not sure, but I remember that I fix it when I type “ipython name.py”, but it doesn’t work.

And when i start ROOT, I get this:

Couldn't find font "-adobe-helvetica-medium-r-*-*-10-*-*-*-*-*-iso8859-1",
trying "fixed". Please fix your system so helvetica can be found, 
this font typically is in the rpm (or pkg equivalent) package 
XFree86-[75,100]dpi-fonts or fonts-xorg-[75,100]dpi.

I have used this manual here. [url]Adobe helvetica on ubuntu 11.04 Please don’t say that I have to install ROOT again. :stuck_out_tongue:

Hm, does anybody know how I can solve my two last problems?

Hi,

no idea about the font, but as for the canvas, what does the script actually do?

Cheers,
Wim

What concerns fonts, maybe you could try [url]Font problem in TBrowser. Ubuntu 12.04

@Wim:
The script should just plot a histogram and calculate some things (mean, …). Maybe there is a problem with iPython?!

Hi,

that description does not tell me anything. Better to post the (a minimal version of the) script and what it is supposed to do.

Cheers,
Wim

If I run this programm (http://root.cern.ch/svn/root/trunk/tutorials/pyroot/tornado.py), I get this in the terminal: code1
tornado : Real Time = 0.13 seconds Cpu Time = 0.09 seconds[/code]

The picture of the tornado is visible for 0.5 seconds maybe.

Hi,

run:$ python -i tornado.pyto get an interactive prompt, keeping the application (and hence the window) alive. The python default, when given a file, is to execute and exit. This is different from root.exe’s behavior.

Cheers,
Wim

Hi,

thanks for your help! It works now! :smiley: