# Using TUnfold 17. 9 with PyROOT

**URL:** <https://root-forum.cern.ch/t/using-tunfold-17-9-with-pyroot/62189>\
**Category:** Newbie\
**Tags:** python\
**Created:** [November 9, 2024, 2:39pm UTC](https://root-forum.cern.ch/t/using-tunfold-17-9-with-pyroot/62189 "2024-11-09T14:39:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mandalaritra1](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/mandalaritra1/32/37924_2.png) [@mandalaritra1](https://root-forum.cern.ch/u/mandalaritra1)\
**Post date:** [November 9, 2024, 2:39pm UTC](https://root-forum.cern.ch/t/using-tunfold-17-9-with-pyroot/62189/1 "2024-11-09T14:39:37Z")

</div>

* * *

_ROOT Version:_ 6. 28/02  
_Platform:_ Docker image (linux)  
_Compiler:_ Not Provided

* * *

Hello,  
My question is similar to another post from 2017. I am posting this since I could not find a solution on this forum.

I want to use the latest version (v17.9) of TUnfold. However, latest version of ROOT comes with TUnfold v17 . 6 .

I downloaded the latest package and produced the corresponding library file `libunfold .so`.

Now, in the same directory I am using the following lines to load the library -

```python
import ROOT
ROOT .gInterpreter.ProcessLine('#include "TUnfold.h"')
ROOT .gSystem.Load('libunfold.so')

```

Now if I use `ROOT. TUnfold(). GetTUnfoldVersion()`, i get v17.6 (vs v17.9) and the newer methods are also not available.

I am posting the full log with `gDebug = 1` below

```python
ROOT.gDebug = 1
ROOT.gInterpreter.ProcessLine('#include "TUnfold.h"')

```

Output:  
Info in TUnixSystem::Load: loaded library /usr/ lib64/ root/ libUnfold.so.6.28.02, status 0  
Info in TInterpreter::TCling::AutoLoad: loaded library libUnfold.so for TUnfold.h

```python
ROOT. gSystem. Load('libunfold.so')

```

Output:

TClass::GetClass: Header Parsing - The representation of Experimental was not found in the type system. A lookup in the interpreter is about to be tried: this can cause parsing. This can be avoided selecting Experimental in the linkdef/selection file. TEnum::GetEnum: Header Parsing - The enumerator Experimental is not known to the typesystem: an interpreter lookup will be performed. This can imply parsing of headers. This can be avoided selecting the numerator in the linkdef/selection file. TClass::GetClass: Header Parsing - The representation of Experimental was not found in the type system. A lookup in the interpreter is about to be tried: this can cause parsing. This can be avoided selecting Experimental in the linkdef/selection file. TEnum::GetEnum: Header Parsing - The enumerator Experimental is not known to the typesystem: an interpreter lookup will be performed. This can imply parsing of headers. This can be avoided selecting the numerator in the linkdef/selection file. TClass::GetClass: Header Parsing - The representation of Experimental was not found in the type system. A lookup in the interpreter is about to be tried: this can cause parsing. This can be avoided selecting Experimental in the linkdef/selection file. TEnum::GetEnum: Header Parsing - The enumerator Experimental is not known to the typesystem: an interpreter lookup will be performed. This can imply parsing of headers. This can be avoided selecting the numerator in the linkdef/selection file.

Info in TUnixSystem::Load: loaded library / work/ unfold/toy\_MC/tunfold\_v17.9/libunfold. so, status 0

As you can see, TUnfold is being loaded from the old library. I need it to use the new ‘libunfold. so’ instead.

Am I doing something wrong?

Thank you!

---

<div class="post-metadata">

**Author:** ![Danilo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/danilo/32/34528_2.png) [@Danilo](https://root-forum.cern.ch/u/Danilo)\
**Post date:** [November 9, 2024, 4:35pm UTC](https://root-forum.cern.ch/t/using-tunfold-17-9-with-pyroot/62189/2 "2024-11-09T16:35:24Z")

</div>

Hi Aritra,

Welcome to the ROOT Community!  
You are doing nothing wrong. The solution is to give precedence to the path of the header file and library of the more recent version of `TUnfold` on your system. You can either try out with their explicit path or give precedence to the directories where the header and library are with the `ROOT_INCLUDE_PATH` and `LD_LIBRARY_PATH `env variables.

I hope this helps.

Best,  
D

---

<div class="post-metadata">

**Author:** ![Danilo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/danilo/32/34528_2.png) [@Danilo](https://root-forum.cern.ch/u/Danilo)\
**Post date:** [November 9, 2024, 4:40pm UTC](https://root-forum.cern.ch/t/using-tunfold-17-9-with-pyroot/62189/3 "2024-11-09T16:40:54Z")

</div>

As a side note: the [imminent ROOT 6.34 release](https://root.cern/doc/v634/release-notes.html#upgrade-tunfold-to-version-17.9) will provide `TUnfold` 17.9 natively, if that can help…

Cheers,  
D

---

<div class="post-metadata">

**Author:** ![mandalaritra1](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/mandalaritra1/32/37924_2.png) [@mandalaritra1](https://root-forum.cern.ch/u/mandalaritra1)\
**Post date:** [November 9, 2024, 6:07pm UTC](https://root-forum.cern.ch/t/using-tunfold-17-9-with-pyroot/62189/4 "2024-11-09T18:07:44Z")

</div>

Thanks for the help! I tried setting the PATH manually in .bashrc, but it did not work. There seems to an error with the library itself.

cling::DynamicLibraryManager::loadLibrary(): [/home/aritra/Desktop/tunfold\_v17\_9/libunfold.so](http://localhost:8888/lab/tree/libunfold.so): undefined symbol: \_ZN21TUn\_am\_foldBinningV178StreamerER7TBuffer

However, the example files provided compiles perfectly when compiled using `make bin`.

But, it is great news that TUnfold v17.9 will be part of ROOT by this month!

Thank you,  
Aritra
