# ./configure does not find libpython2.7?

**URL:** <https://root-forum.cern.ch/t/configure-does-not-find-libpython2-7/14703>\
**Category:** ROOT\
**Created:** [August 3, 2012, 9:57pm UTC](https://root-forum.cern.ch/t/configure-does-not-find-libpython2-7/14703 "2012-08-03T21:57:01Z")\
**Posts on this page:** 7\
**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 3, 2012, 9:57pm UTC](https://root-forum.cern.ch/t/configure-does-not-find-libpython2-7/14703/1 "2012-08-03T21:57:01Z")

</div>

I’ve installed Python2.7 with --enable-shared option:

`[0 root]$ 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
[0 root]$ 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`

Now, the root configure does not find libpython2.7:

`./configure macosx --enable-python --prefix=$PWD/try --etcdir=$PWD/try/etc/root
...
Checking for Python.h ... /usr/local/bin/../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.
...`

Why?

---

<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 3, 2012, 10:29pm UTC](https://root-forum.cern.ch/t/configure-does-not-find-libpython2-7/14703/2 "2012-08-03T22:29:21Z")

</div>

A brutal fix …  
Try to execute:  
python-config --includes  
python-config --cflags  
python-config --ldflags  
The outputs of the first two commands should contain something like “-I/path/to/your/python/includes”, while the output of the third command should contain something like “-L/path/to/your/python/libraries”.  
Then try to configure ROOT using:  
–enable-python --with-python-incdir=/path/to/your/python/includes --with-python-libdir=/path/to/your/python/libraries

---

<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, 2:14pm UTC](https://root-forum.cern.ch/t/configure-does-not-find-libpython2-7/14703/3 "2012-08-04T14:14:50Z")

</div>

Thanks for help. The output of these commands is:

[code]python-config --includes  
-I/usr/local/Cellar/python/2.7.3/include/python2.7 -I/usr/local/Cellar/python/2.7.3/include/python2.7

python-config --cflags  
-I/usr/local/Cellar/python/2.7.3/include/python2.7 -I/usr/local/Cellar/python/2.7.3/include/python2.7 -fno-strict-aliasing -Os -w -pipe -march=native -Qunused-arguments -mmacosx-version-min=10.8 -fwrapv -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes

python-config --ldflags  
-ldl -framework CoreFoundation -lpython2.7 -u \_PyMac\_Error[/code]

So, there is no -L. However, I’ve tried this:

[code]ls -l `python-config --prefix`/include/python2.7  
…  
-rw-r–r-- 1 samvel admin 4329 Aug 3 16:40 Python.h  
…  
ls -l `python-config --prefix`/lib  
…  
-r-xr-xr-x 1 samvel admin 2030792 Aug 3 16:41 libpython2.7.dylib  
…

./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  
…  
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.[/code]

Again: Python is not enabled ☹

---

<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, 2:30pm UTC](https://root-forum.cern.ch/t/configure-does-not-find-libpython2-7/14703/4 "2012-08-04T14:30:59Z")

</div>

Try (maybe this will contain “-L”):  
python-config --libs

If this fails, try to ask this question on the “PyROOT Support” forum: [http://root.cern.ch/phpBB3/viewforum.php?f=14](http://root.cern.ch/phpBB3/viewforum.php?f=14)

---

<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, 2:51pm UTC](https://root-forum.cern.ch/t/configure-does-not-find-libpython2-7/14703/5 "2012-08-04T14:51:43Z")

</div>

Maybe you could also check:  
echo $PYTHONDIR  
type python  
which python

---

<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:21pm UTC](https://root-forum.cern.ch/t/configure-does-not-find-libpython2-7/14703/6 "2012-08-04T15:21:09Z")

</div>

Thanks @pepe. I’ll ask this question on PyROOT then.

---

<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:25pm UTC](https://root-forum.cern.ch/t/configure-does-not-find-libpython2-7/14703/7 "2012-08-04T15:25:06Z")

</div>

Note … this thread is “continued” in: [url][PyROOT on OS X 10.8: libpython2.7 is not found](https://root-forum.cern.ch/t/pyroot-on-os-x-10-8-libpython2-7-is-not-found/14706/1)
