# Error while running inference.py from TMVA SOFIE tutorials

**URL:** <https://root-forum.cern.ch/t/error-while-running-inference-py-from-tmva-sofie-tutorials/63039>\
**Category:** Newbie\
**Tags:** python, root\
**Created:** [February 27, 2025, 11:01am UTC](https://root-forum.cern.ch/t/error-while-running-inference-py-from-tmva-sofie-tutorials/63039 "2025-02-27T11:01:41Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prasanna\_Kasar](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/prasanna_kasar/32/38528_2.png) [@Prasanna\_Kasar](https://root-forum.cern.ch/u/Prasanna_Kasar)\
**Post date:** [February 27, 2025, 11:01am UTC](https://root-forum.cern.ch/t/error-while-running-inference-py-from-tmva-sofie-tutorials/63039/1 "2025-02-27T11:01:41Z")

</div>

Hi, I am preparing for TMVA SOFIE in this years GSoC  
I tried to run the inference.py tutorial from TMVA SOFIE website and I got this error:

Traceback (most recent call last):  
File “/home/prasanna/Desktop/Prasanna/SOFIE/inference.py”, line 5, in   
ROOT.TMVA.PyMethodBase.PyInitialize()  
^^^^^^^^^^^^^^^^^^^^^^  
AttributeError: \<namespace cppyy.gbl.TMVA at 0x392d9010\> has no attribute ‘PyMethodBase’. Full details:  
type object ‘TMVA’ has no attribute ‘PyMethodBase’  
‘TMVA::PyMethodBase’ is not a known C++ class  
‘PyMethodBase’ is not a known C++ template  
‘PyMethodBase’ is not a known C++ enum

I have Ubuntu 24.04 LTS  
I have built and installed ROOT using documentation from the ROOT website  
I have added environment variable in /.bashrc: source /home/prasanna/RootDevelopment/root/build/bin/thisroot.sh  
Also, I have build ROOT using this: cmake -DCMAKE\_BUILD\_TYPE=Debug -Dtesting=ON -Droottest=ON -Dtmva-sofie=ON **-Dtmva-pymva=On** …/root

Can anyone please help me?

---

<div class="post-metadata">

**Author:** ![mczurylo](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/mczurylo/32/33269_2.png) [@mczurylo](https://root-forum.cern.ch/u/mczurylo)\
**Post date:** [February 27, 2025, 1:54pm UTC](https://root-forum.cern.ch/t/error-while-running-inference-py-from-tmva-sofie-tutorials/63039/2 "2025-02-27T13:54:54Z")

</div>

Hi @Prasanna_Kasar,

welcome to the ROOT Forum. I have tried to quickly run this tutorial on my machine and I also get an error, let’s tag our TMVA expert @moneta to get some more insights.

Cheers,  
Marta

---

<div class="post-metadata">

**Author:** ![Prasanna\_Kasar](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/prasanna_kasar/32/38528_2.png) [@Prasanna\_Kasar](https://root-forum.cern.ch/u/Prasanna_Kasar)\
**Post date:** [February 28, 2025, 11:51pm UTC](https://root-forum.cern.ch/t/error-while-running-inference-py-from-tmva-sofie-tutorials/63039/3 "2025-02-28T23:51:54Z")

</div>

Hi @mczurylo

I hope you’re doing well.

I wanted to ask if there is a specific channel where I can find the tasks for this year’s GSoC projects under TMVA SOFIE. I know this might not be the best place to ask, and you may not be directly involved with GSoC updates for ROOT, but I couldn’t find a better place to ask this question. I also wasn’t sure if raising a new issue on the forum would be appropriate.

I’d really appreciate any guidance or pointers you can provide.

Thank you in advance!

---

<div class="post-metadata">

**Author:** ![moneta](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/moneta/32/19423_2.png) [@moneta](https://root-forum.cern.ch/u/moneta)\
**Post date:** [March 3, 2025, 10:40am UTC](https://root-forum.cern.ch/t/error-while-running-inference-py-from-tmva-sofie-tutorials/63039/4 "2025-03-03T10:40:51Z")

</div>

Hello,

The isue you are having is probably due to the fact that your pymva is not enabled in the ROOT build. Can you check at the end what is enabled and if Python and Numpy are correctly found. These are needed for enabling pymva.

Concerning GSOC, you can email directly the mentors for getting assignment tasks in order to apply for the projects. You can find their email in the Website:  
[https://hepsoftwarefoundation.org/gsoc/2025/proposal\_TMVA-SOFIE-GPU.html](https://hepsoftwarefoundation.org/gsoc/2025/proposal_TMVA-SOFIE-GPU.html)

Best Regards

Lorenzo

---

<div class="post-metadata">

**Author:** ![Prasanna\_Kasar](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/prasanna_kasar/32/38528_2.png) [@Prasanna\_Kasar](https://root-forum.cern.ch/u/Prasanna_Kasar)\
**Post date:** [March 3, 2025, 10:54am UTC](https://root-forum.cern.ch/t/error-while-running-inference-py-from-tmva-sofie-tutorials/63039/5 "2025-03-03T10:54:23Z")

</div>

Hi @moneta

Thank you for your response! I was able to rebuild the root with `Dtmva-pymva=On`, and it worked perfectly!

Regarding GSoC 2025, I already sent you an email on February 28th. Could you kindly take a look at it? If you didn’t receive it, please let me know, and I’ll be happy to resend it.

Thanks again!

---

<div class="post-metadata">

**Author:** ![Prasanna\_Kasar](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/prasanna_kasar/32/38528_2.png) [@Prasanna\_Kasar](https://root-forum.cern.ch/u/Prasanna_Kasar)\
**Post date:** [March 3, 2025, 11:04am UTC](https://root-forum.cern.ch/t/error-while-running-inference-py-from-tmva-sofie-tutorials/63039/6 "2025-03-03T11:04:14Z")

</div>

Hello @moneta,  
Just an update  
I just received the tasks for TMVA SOFIE from Sanjiban Sengupta  
Thanks for the follow up!
