Setting up pyroot from source with functional ROOT built


I’m having trouble with setting up pyroot correctly.

So I tried
./configure [] [–with-python-incdir=] [–with-python-libdir=]

but I’m not able to find the directory of my python library, (referring to the second option).
Is it ok if I skip that ? By the way I’m using macosx64 for arch and I’m using ROOT 5.34.34.

Any helps are appreciated.

Hi Annie,

you will most likely need the python include directory and the location of the shared library if you want to compile pyroot from sources - without these, your pyroot cannot be built.

I’m not familar enough is OS/X really, but you could try to use the find command like this:

find / -name 'libpython*.so*' -o -name 'libpython*.dylib*'

If you have a library somewhere on your system that might fit the bill, this command should be able to find it, although it may take a while because it searches your entire file system. You’ll need a file with .dylib extension. Users on other *nix-like systems will likely need a version with .so extension. (I’ve made the find command look for both, so it’ll potentially be useful for others, too.)

If this doesn’t turn up a directory with shared libraries, you may find it useful to build your own python on OS/X (although I am not sure it’s required) - that way you get to choose where the shared library goes, and you know it’s there. Projects like Homebrew or MacPorts may (or may not) help in getting things built - I’m sure OS/X experts can comment on this.

If you do not manage, I’m sure there are OS/X experts out there who know much more on this topic than I do… Still, I hope these little hints help!



Hey, thank you very much !
Well it’s been a while… But, yeah that is what I did, it’s confusing that I don’t seem to have a .so file while the user’s guide asked me to find path to a .so file,

so it seems the dynamic library file should work as well, right ?

I found this:

at two places:


Does it matter which one I use ?

Well, most *nix-like systems use .so for shared libs (I think most LHC experiments run on some form of Linux, so the user base there is large, and the documentation seems to reflect that), OS/X seems to use .dylib, .dll is used on Windows. In your case, I’d probably use the second one, but I’m not sure…

Thank you, I used the first one previously and it crashed at the make stage,
and I’ll try the second one and see if it works.

It occurs to me that maybe your python interpreter + libraries is too new. It could be that pyroot still needs Python 2.7.x, whereas you seem to have the shiny new Python 3.X… In any case, I cannot consciously remember a time when my pyroot was linked against Python 3. Experts can probably comment. Sorry, I should have thought of this earlier…

Oh, I don’t know that, maybe…
it’s a bit unfortunate if that is true since I have been using Python 3…

Well, I tried both kinds of locations to the python library and Python.h,
and it always crash at the make command stage… And I couldn’t think of anything else that might be wrong.

Anyway, thank you for keeping up with my question and let me know if you think of anything else :slight_smile:


v5.34 has been frozen and only support python 2.7. To use ROOT with python 3, please use v6.08.


This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.