# PyROOT and Ubuntu 12.04

**URL:** <https://root-forum.cern.ch/t/pyroot-and-ubuntu-12-04/14227>\
**Category:** ROOT\
**Created:** [May 2, 2012, 1:30am UTC](https://root-forum.cern.ch/t/pyroot-and-ubuntu-12-04/14227 "2012-05-02T01:30:49Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maxwell](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/d07c76/32.png) [@Maxwell](https://root-forum.cern.ch/u/Maxwell)\
**Post date:** [May 2, 2012, 1:30am UTC](https://root-forum.cern.ch/t/pyroot-and-ubuntu-12-04/14227/1 "2012-05-02T01:30:49Z")

</div>

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! 🙂

Maxwell

---

<div class="post-metadata">

**Author:** ![wlav](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/w/f07891/32.png) [@wlav](https://root-forum.cern.ch/u/wlav)\
**Post date:** [May 2, 2012, 2:17pm UTC](https://root-forum.cern.ch/t/pyroot-and-ubuntu-12-04/14227/2 "2012-05-02T14:17:32Z")

</div>

Hi,

the easiest is to build ROOT from source, but what does “some problems” mean? Note that there was this [savannah report](https://savannah.cern.ch/bugs/?94109), which may be the same for you?

Cheers,  
Wim

---

<div class="post-metadata">

**Author:** ![Maxwell](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/d07c76/32.png) [@Maxwell](https://root-forum.cern.ch/u/Maxwell)\
**Post date:** [May 2, 2012, 8:02pm UTC](https://root-forum.cern.ch/t/pyroot-and-ubuntu-12-04/14227/3 "2012-05-02T20:02:14Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![wlav](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/w/f07891/32.png) [@wlav](https://root-forum.cern.ch/u/wlav)\
**Post date:** [May 2, 2012, 8:07pm UTC](https://root-forum.cern.ch/t/pyroot-and-ubuntu-12-04/14227/4 "2012-05-02T20:07:34Z")

</div>

Hi,

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

Cheers,  
Wim

---

<div class="post-metadata">

**Author:** ![Maxwell](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/d07c76/32.png) [@Maxwell](https://root-forum.cern.ch/u/Maxwell)\
**Post date:** [May 2, 2012, 9:14pm UTC](https://root-forum.cern.ch/t/pyroot-and-ubuntu-12-04/14227/5 "2012-05-02T21:14:41Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![wlav](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/w/f07891/32.png) [@wlav](https://root-forum.cern.ch/u/wlav)\
**Post date:** [May 3, 2012, 12:17am UTC](https://root-forum.cern.ch/t/pyroot-and-ubuntu-12-04/14227/6 "2012-05-03T00:17:22Z")

</div>

Hi,

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

Cheers,  
Wim

---

<div class="post-metadata">

**Author:** ![Maxwell](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/d07c76/32.png) [@Maxwell](https://root-forum.cern.ch/u/Maxwell)\
**Post date:** [May 3, 2012, 12:25am UTC](https://root-forum.cern.ch/t/pyroot-and-ubuntu-12-04/14227/7 "2012-05-03T00:25:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Maxwell](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/d07c76/32.png) [@Maxwell](https://root-forum.cern.ch/u/Maxwell)\
**Post date:** [May 3, 2012, 1:15pm UTC](https://root-forum.cern.ch/t/pyroot-and-ubuntu-12-04/14227/8 "2012-05-03T13:15:39Z")

</div>

Ok, I have solved the problem now! 🙂 I installed it again, but this time I typed “./configure --enable-python --prefix=/home/…/root\_v5.32.01”. 😛

---

<div class="post-metadata">

**Author:** ![Pepe\_Le\_Pew](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pepe_le_pew/32/12365_2.png) [@Pepe\_Le\_Pew](https://root-forum.cern.ch/u/Pepe_Le_Pew)\
**Post date:** [May 3, 2012, 1:20pm UTC](https://root-forum.cern.ch/t/pyroot-and-ubuntu-12-04/14227/9 "2012-05-03T13:20:14Z")

</div>

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](https://root-forum.cern.ch/t/installing-root-from-source/13647/1)

---

<div class="post-metadata">

**Author:** ![Maxwell](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/d07c76/32.png) [@Maxwell](https://root-forum.cern.ch/u/Maxwell)\
**Post date:** [May 3, 2012, 3:14pm UTC](https://root-forum.cern.ch/t/pyroot-and-ubuntu-12-04/14227/10 "2012-05-03T15:14:47Z")

</div>

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! 😃  
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](http://name.py)”, but it doesn’t work.

And when i start ROOT, I get this:

```auto
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](https://root-forum.cern.ch/t/adobe-helvetica-on-ubuntu-11-04/12319/1) Please don’t say that I have to install ROOT again. 😛

---

<div class="post-metadata">

**Author:** ![Maxwell](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/d07c76/32.png) [@Maxwell](https://root-forum.cern.ch/u/Maxwell)\
**Post date:** [May 4, 2012, 4:54pm UTC](https://root-forum.cern.ch/t/pyroot-and-ubuntu-12-04/14227/11 "2012-05-04T16:54:01Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![wlav](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/w/f07891/32.png) [@wlav](https://root-forum.cern.ch/u/wlav)\
**Post date:** [May 4, 2012, 6:34pm UTC](https://root-forum.cern.ch/t/pyroot-and-ubuntu-12-04/14227/12 "2012-05-04T18:34:02Z")

</div>

Hi,

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

Cheers,  
Wim

---

<div class="post-metadata">

**Author:** ![Pepe\_Le\_Pew](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/pepe_le_pew/32/12365_2.png) [@Pepe\_Le\_Pew](https://root-forum.cern.ch/u/Pepe_Le_Pew)\
**Post date:** [May 10, 2012, 7:38am UTC](https://root-forum.cern.ch/t/pyroot-and-ubuntu-12-04/14227/13 "2012-05-10T07:38:07Z")

</div>

What concerns fonts, maybe you could try [url][Font problem in TBrowser. Ubuntu 12.04](https://root-forum.cern.ch/t/font-problem-in-tbrowser-ubuntu-12-04/14266/1)

---

<div class="post-metadata">

**Author:** ![Maxwell](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/d07c76/32.png) [@Maxwell](https://root-forum.cern.ch/u/Maxwell)\
**Post date:** [May 18, 2012, 3:34pm UTC](https://root-forum.cern.ch/t/pyroot-and-ubuntu-12-04/14227/14 "2012-05-18T15:34:30Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![wlav](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/w/f07891/32.png) [@wlav](https://root-forum.cern.ch/u/wlav)\
**Post date:** [May 21, 2012, 4:50pm UTC](https://root-forum.cern.ch/t/pyroot-and-ubuntu-12-04/14227/15 "2012-05-21T16:50:15Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Maxwell](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/d07c76/32.png) [@Maxwell](https://root-forum.cern.ch/u/Maxwell)\
**Post date:** [June 15, 2012, 8:54am UTC](https://root-forum.cern.ch/t/pyroot-and-ubuntu-12-04/14227/16 "2012-06-15T08:54:01Z")

</div>

If I run this programm ([http://root.cern.ch/svn/root/trunk/tutorials/pyroot/tornado.py](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.

---

<div class="post-metadata">

**Author:** ![wlav](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/w/f07891/32.png) [@wlav](https://root-forum.cern.ch/u/wlav)\
**Post date:** [June 15, 2012, 5:38pm UTC](https://root-forum.cern.ch/t/pyroot-and-ubuntu-12-04/14227/17 "2012-06-15T17:38:05Z")

</div>

Hi,

run:`$ python -i tornado.py`to 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

---

<div class="post-metadata">

**Author:** ![Maxwell](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/m/d07c76/32.png) [@Maxwell](https://root-forum.cern.ch/u/Maxwell)\
**Post date:** [July 2, 2012, 4:07pm UTC](https://root-forum.cern.ch/t/pyroot-and-ubuntu-12-04/14227/18 "2012-07-02T16:07:11Z")

</div>

Hi,

thanks for your help! It works now! 😃
