# PyROOT on OS X 10.8: libpython2.7 is not found

**URL:** <https://root-forum.cern.ch/t/pyroot-on-os-x-10-8-libpython2-7-is-not-found/14706>\
**Category:** ROOT\
**Created:** [August 4, 2012, 3:20pm UTC](https://root-forum.cern.ch/t/pyroot-on-os-x-10-8-libpython2-7-is-not-found/14706 "2012-08-04T15:20:28Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ksamdev](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ksamdev/32/11265_2.png) [@ksamdev](https://root-forum.cern.ch/u/ksamdev)\
**Post date:** [August 4, 2012, 3:20pm UTC](https://root-forum.cern.ch/t/pyroot-on-os-x-10-8-libpython2-7-is-not-found/14706/1 "2012-08-04T15:20:28Z")

</div>

Hi,

I am trying to configure ROOT with Python support but it fails because configure script can not find python lib:

`./configure macosx --enable-python --prefix=$PWD/try --etcdir=$PWD/try/etc/root
...
Checking for Python.h ... /usr/local/Cellar/python/2.7.3/include/python2.7
Checking for python2.7, libpython2.7, libpython, python, or Python ... no
...
Enabled support for asimage, astiff, bonjour, builtin_afterimage, builtin_ftgl, builtin_glew, builtin_pcre, builtin_lzma, cintex, explicitlink, fink, genvector, krb5, ldap, memstat, odbc, opengl, reflex, shared, ssl, tmva, x11, xft, xml.
...`

I’ve also tried:

`./configure macosx --enable-python --prefix=$PWD/try --etcdir=$PWD/try/etc/root --with-python-incdir=`python-config --prefix`/include/python2.7 --with-python-libdir=`python-config --prefix`/lib
`  
But it leads to the same issue.

My setup is:

[code]python-config --prefix  
/usr/local/Cellar/python/2.7.3

ll /usr/local/lib/libpython2.7.dylib  
lrwxr-xr-x 1 samvel admin 45 Aug 3 16:41 /usr/local/lib/libpython2.7.dylib -\> …/Cellar/python/2.7.3/lib/libpython2.7.dylib

ll /usr/local/Cellar/python/2.7.3/lib/libpython2.7.dylib  
-r-xr-xr-x 1 samvel admin 2030792 Aug 3 16:41 /usr/local/Cellar/python/2.7.3/lib/libpython2.7.dylib[/code]

What am I doing wrong?

---

<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:** [August 4, 2012, 3:44pm UTC](https://root-forum.cern.ch/t/pyroot-on-os-x-10-8-libpython2-7-is-not-found/14706/2 "2012-08-04T15:44:26Z")

</div>

Note … this thread is a “continuation” of: [url][./configure does not find libpython2.7?](https://root-forum.cern.ch/t/configure-does-not-find-libpython2-7/14703/1)

One more thing … what ROOT version are you trying to use exactly?  
In the previous thread [url][Canvas does not show up in OSX 10.8 with XQuartz 2.7.2?](https://root-forum.cern.ch/t/canvas-does-not-show-up-in-osx-10-8-with-xquartz-2-7-2/14688/1) “tpochep” mentions some recent modifications “in both trunk and 5-34 specially for Mac OS X 8”.  
Maybe you could try to download the source of the head of the v5-34-00-patches branch:  
svn co [root.cern.ch/svn/root/branches/v5-34-00-patches](http://root.cern.ch/svn/root/branches/v5-34-00-patches) root

---

<div class="post-metadata">

**Author:** ![ksamdev](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ksamdev/32/11265_2.png) [@ksamdev](https://root-forum.cern.ch/u/ksamdev)\
**Post date:** [August 4, 2012, 4:15pm UTC](https://root-forum.cern.ch/t/pyroot-on-os-x-10-8-libpython2-7-is-not-found/14706/3 "2012-08-04T16:15:20Z")

</div>

Thanks @pepe for the summary and links.

I am trying to install ROOT v5.34.01. The XQuartz (X11) moved to /opt/X11 in OS X 10.8 and this may lead to ROOT installation/setup problems. However, it works fine in my case.

The problem, I guess, is in the Python installation and the fact ROOT can not find library for some reason. This is the problem I do not understand: why? The library seem to be there and Python is setup on the computer.

---

<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:** [August 4, 2012, 7:19pm UTC](https://root-forum.cern.ch/t/pyroot-on-os-x-10-8-libpython2-7-is-not-found/14706/4 "2012-08-04T19:19:17Z")

</div>

I’ve been comparing the output of different “python-config” commands between you and me …

I’ve got an idea … maybe you could try …  
–with-python-incdir=`python-config --prefix`/include/python2.7  
–with-python-libdir=`python-config --prefix`/lib/python2.7/config  
… or maybe …  
–with-python-libdir=`python-config --prefix`/lib/python2.7

That’s because I get (Python 2.6.5 on Ubuntu) …  
python-config --prefix … /usr  
python-config --includes … -I/usr/include/python2.6  
python-config --ldflags … -L/usr/lib/python2.6/config

---

<div class="post-metadata">

**Author:** ![ksamdev](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ksamdev/32/11265_2.png) [@ksamdev](https://root-forum.cern.ch/u/ksamdev)\
**Post date:** [August 4, 2012, 8:41pm UTC](https://root-forum.cern.ch/t/pyroot-on-os-x-10-8-libpython2-7-is-not-found/14706/5 "2012-08-04T20:41:35Z")

</div>

Thanks for looking into this. Unfortunately, the solution

```auto

```

does not work.

---

<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:** [August 4, 2012, 8:49pm UTC](https://root-forum.cern.ch/t/pyroot-on-os-x-10-8-libpython2-7-is-not-found/14706/6 "2012-08-04T20:49:58Z")

</div>

And do you have a subdirectory (or is it just Ubuntu’s peculiarity where they keep libraries and another configuration related files) …  
`python-config --prefix`/lib/python2.7/config

---

<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:** [August 5, 2012, 12:20pm UTC](https://root-forum.cern.ch/t/pyroot-on-os-x-10-8-libpython2-7-is-not-found/14706/7 "2012-08-05T12:20:23Z")

</div>

I’ve got another idea … maybe you could attach here the “config.log” file which was created by the configure script (rename this file into “config.log.txt”) … this file should contain more detailed information what has failed when looking for the python’s library.

Another point … can it be that you try to compile a 32-bit ROOT, but your python’s library is a 64-bit one?

---

<div class="post-metadata">

**Author:** ![ksamdev](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/ksamdev/32/11265_2.png) [@ksamdev](https://root-forum.cern.ch/u/ksamdev)\
**Post date:** [August 5, 2012, 4:24pm UTC](https://root-forum.cern.ch/t/pyroot-on-os-x-10-8-libpython2-7-is-not-found/14706/8 "2012-08-05T16:24:25Z")

</div>

@pepe, the problem is solved. It was simply incompatibility of libs: python is generated for 64 while I was trying to compile ROOT for 32bits arch. 🙂 The right configuration is:

```auto

```

Thanks for your help.
