# Compiling ROOT 6.12/06 with anaconda python 3.6

**URL:** <https://root-forum.cern.ch/t/compiling-root-6-12-06-with-anaconda-python-3-6/28157>\
**Category:** ROOT\
**Created:** [March 2, 2018, 3:55pm UTC](https://root-forum.cern.ch/t/compiling-root-6-12-06-with-anaconda-python-3-6/28157 "2018-03-02T15:55:20Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![hits](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/hits/32/15840_2.png) [@hits](https://root-forum.cern.ch/u/hits)\
**Post date:** [March 2, 2018, 3:55pm UTC](https://root-forum.cern.ch/t/compiling-root-6-12-06-with-anaconda-python-3-6/28157/1 "2018-03-02T15:55:20Z")

</div>

Hi,

I have tried finding a recipe that works for using my anaconda python installation with ROOT 6.12/06 but without luck. Has anyone succeeded in doing so? My OS is OSX 10.13.3. The ROOT compiles and works without a problem, but when I start python and type:

> > > import ROOT  
> > > it crashes with a nasty message:

\*\*\* Break \*\*\* segmentation violation  
[/usr/lib/system/libsystem\_platform.dylib] \_sigtramp (no debug info)  
[] (no debug info)  
[/Users/hits/anaconda3/lib/libpython3.6m.dylib] PyUnicode\_InternFromString (no debug info)  
[/Users/hits/Applications/root/build\_dir2/lib/libPyROOT.so] PyROOT::CreatePyStrings() /Users/hits/Applications/root/bindings/pyroot/src/PyStrings.cxx:64  
[/Users/hits/Applications/root/build\_dir2/lib/libPyROOT.so] PyInit\_libPyROOT /Users/hits/Applications/root/bindings/pyroot/src/RootModule.cxx:848  
[/Users/hits/anaconda3/bin/python] \_PyImport\_LoadDynamicModuleWithSpec (no debug info)  
[/Users/hits/anaconda3/bin/python] \_imp\_create\_dynamic (no debug info)  
[/Users/hits/anaconda3/bin/python] PyCFunction\_Call (no debug info)

I only pasted part of it here, because I do not see anything I can use there to figure out the problem. If someone else thinks that it may help to figure out the problem I will gladly paste the rest.

My setup was the following:

cmake -Dall=On -DPYTHON\_EXECUTABLE=/Users/hits/anaconda3/bin/python -DPYTHON\_INCLUDE\_DIR=/Users/hits/anaconda3/include/python3.6m -DPYTHON\_LIBRARY=/Users/hits/anaconda3/lib/libpython3.6m.dylib -Dpython3=ON …/

Does anyone see anything wrong with it?

anaconda python is my default python:  
$ which python  
/Users/hits/anaconda3/bin/python

Any help greatly appreciated!

Cheers,

Dmitry

---

<div class="post-metadata">

**Author:** ![couet](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/couet/32/12037_2.png) [@couet](https://root-forum.cern.ch/u/couet)\
**Post date:** [March 5, 2018, 1:02pm UTC](https://root-forum.cern.ch/t/compiling-root-6-12-06-with-anaconda-python-3-6/28157/2 "2018-03-05T13:02:20Z")

</div>

May be @etejedor will have an idea about your problem.

---

<div class="post-metadata">

**Author:** ![etejedor](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/e/e79b87/32.png) [@etejedor](https://root-forum.cern.ch/u/etejedor)\
**Post date:** [March 5, 2018, 1:28pm UTC](https://root-forum.cern.ch/t/compiling-root-6-12-06-with-anaconda-python-3-6/28157/3 "2018-03-05T13:28:10Z")

</div>

Hi Dmitry,

The issue with PyROOT and anaconda, which is explained here:

[https://sft.its.cern.ch/jira/browse/ROOT-9145](https://sft.its.cern.ch/jira/browse/ROOT-9145)

is that you need to compile ROOT with the same compiler that anaconda provides, if that is an option for you (that is, if the compiler is not too old).

Cheers,

Enric

---

<div class="post-metadata">

**Author:** ![hits](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/hits/32/15840_2.png) [@hits](https://root-forum.cern.ch/u/hits)\
**Post date:** [March 6, 2018, 7:34am UTC](https://root-forum.cern.ch/t/compiling-root-6-12-06-with-anaconda-python-3-6/28157/4 "2018-03-06T07:34:16Z")

</div>

Hi Enric,

Thank you! I will see if it works for me. Do you know by chance how to force cmake to choose the anaconda compiler? I have tried:  
$source activate root  
but cmake still picked the Xcode compiler.

Cheers,

Dmitry

---

<div class="post-metadata">

**Author:** ![etejedor](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/e/e79b87/32.png) [@etejedor](https://root-forum.cern.ch/u/etejedor)\
**Post date:** [March 6, 2018, 9:21am UTC](https://root-forum.cern.ch/t/compiling-root-6-12-06-with-anaconda-python-3-6/28157/5 "2018-03-06T09:21:11Z")

</div>

Hi Dmitry,

Please have a look at:

[https://root.cern.ch/building-root](https://root.cern.ch/building-root)

In section `Variables`, I believe what you are looking for is `CMAKE_CXX_COMPILER`.

Cheers,

Enric

---

<div class="post-metadata">

**Author:** ![hits](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/hits/32/15840_2.png) [@hits](https://root-forum.cern.ch/u/hits)\
**Post date:** [March 11, 2018, 10:33am UTC](https://root-forum.cern.ch/t/compiling-root-6-12-06-with-anaconda-python-3-6/28157/6 "2018-03-11T10:33:50Z")

</div>

After a week of trying different installation methods, I now think that it is impossible to install pyROOT with ROOT6 and with python3 on Mac OSX. And that it does not matter if it is the anaconda python or the python you get directly from [python.org](http://python.org). I would be very interested if anyone can claim otherwise?

I also don’t think that the theory of the different compilers is correct:

My default compiler is 4.2.1

```auto
$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 9.0.0 (clang-900.0.39.2)
Target: x86_64-apple-darwin17.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

```

which is exactly the same as the compiler for anaconda python:

```auto
$python
Python 3.6.4 |Anaconda, Inc.| (default, Jan 16 2018, 12:04:33)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin

```

Cheers,

Dmitry

---

<div class="post-metadata">

**Author:** ![etejedor](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/e/e79b87/32.png) [@etejedor](https://root-forum.cern.ch/u/etejedor)\
**Post date:** [March 12, 2018, 9:08am UTC](https://root-forum.cern.ch/t/compiling-root-6-12-06-with-anaconda-python-3-6/28157/7 "2018-03-12T09:08:00Z")

</div>

Hi Dmitry,

What is exactly the issue you have with Python3 (non-anaconda) on MacOSX? That combination is certainly possible. Could it be that there is some interference with the anaconda Python?

Cheers,

Enric

---

<div class="post-metadata">

**Author:** ![hits](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/hits/32/15840_2.png) [@hits](https://root-forum.cern.ch/u/hits)\
**Post date:** [March 12, 2018, 9:36am UTC](https://root-forum.cern.ch/t/compiling-root-6-12-06-with-anaconda-python-3-6/28157/8 "2018-03-12T09:36:44Z")

</div>

Hi Enric,

The crash was exactly the same as for the anaconda python (as you see in my first post). For that experiment, I removed the anaconda python completely. I can try it again and report here all the steps. Maybe you’ll see something wrong with them.

By the way, my crash is somewhat different from what you had. I get failure similar to yours when I also put python libs in DYLD\_LIBRARY\_PATH.

Cheers,

Dmitry

---

<div class="post-metadata">

**Author:** ![etejedor](https://root-forum.cern.ch/letter_avatar_proxy/v4/letter/e/e79b87/32.png) [@etejedor](https://root-forum.cern.ch/u/etejedor)\
**Post date:** [March 12, 2018, 10:02am UTC](https://root-forum.cern.ch/t/compiling-root-6-12-06-with-anaconda-python-3-6/28157/9 "2018-03-12T10:02:33Z")

</div>

Hi Dmitry,

Yes please post your steps and the final stack trace. Also please attach the CMakeCache.txt file that is created in your build directory so that we can check the Python-related variables.

Cheers,

Enric

---

<div class="post-metadata">

**Author:** ![hits](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/hits/32/15840_2.png) [@hits](https://root-forum.cern.ch/u/hits)\
**Post date:** [March 12, 2018, 12:43pm UTC](https://root-forum.cern.ch/t/compiling-root-6-12-06-with-anaconda-python-3-6/28157/10 "2018-03-12T12:43:55Z")

</div>

Hi Enric,

I take it back. This time it works with the python3.6.4 installed from [python.org](http://python.org)!

I am not sure what did it. Maybe the fact that I updated some libraries with homebrew in the meanwhile.

Thanks for your reply, I wouldn’t have tried it again otherwise!

Cheers,

Dmitry

---

<div class="post-metadata">

**Author:** ![system](https://root-forum.cern.ch/uploads/default/original/3X/e/f/efe4f24398fd8ffeb76bccb6ecc46d9d9c003376.png) [@system](https://root-forum.cern.ch/u/system)\
**Post date:** [March 26, 2018, 12:44pm UTC](https://root-forum.cern.ch/t/compiling-root-6-12-06-with-anaconda-python-3-6/28157/11 "2018-03-26T12:44:03Z")

</div>

Closed on March 26, 2018, 12:44pm UTC

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