Please read tips for efficient and successful posting and posting code
ROOT Version: 6.32.02
Platform: Windows 11
Compiler: cl.exe (I think)
Hello everyone, I hope you are doing well.
This is my first time using ROOT and I am currently trying to set it up and get it working. I am going to provide a lot of information in hopes that this problem is solved faster so, please, bear with me.
My Problem:
Once I’ve started ROOT using C\path\to\root\bin\thisroot.bat
in x64 Native Tools Command Prompt for VS 2022
, and then I try to do import ROOT
in python, I receive this error:
>>> import ROOT
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\CERN ROOT\root\bin\ROOT\__init__.py", line 25, in <module>
import cppyy
File "C:\CERN ROOT\root\bin\cppyy\__init__.py", line 81, in <module>
from ._cpython_cppyy import *
File "C:\CERN ROOT\root\bin\cppyy\_cpython_cppyy.py", line 22, in <module>
import libcppyy as _backend
ImportError: DLL load failed while importing libcppyy: The specified module could not be found.
So for some reason, the program cannot find the file libcppyy
.
How I set up ROOT
So now I’m going to talk about how I went about setting up ROOT, in case someone believes they have a better way of setting it up.
I downloaded the pre-compiled binary distribution on the install page (I specifically installed root_v6.32.02win64.vc17.zip)
I believe I have also downloaded all the required dependencies: CMake (even though I haven’t done anything with it, will say more about that further down), Microsoft Visual C++ & Desktop Development with C++, and Python (Python 3.12.4)
I then extracted the root zip file into a file in my C drive.
I think I’ve set up all the environment variables correctly:
- User
Path
environment variable contains bothC:\path\to\root\bin
andC:\path\to\root\lib
. ROOTSYS
variable toC:\path\to\root
PYTHONPATH
variable toC:\path\to\root\bin
andC:\path\to\root\lib
Now, I’m pretty sure ROOT itself works. I can run root, and use C++ commands to create a graph. It’s just when I run python and try to import ROOT, it fails.
What I haven’t tried
- So I have installed CMake, however I haven’t set it up or added any variables to it because, following the method I did, it didn’t seem to require it?
- In some places I’ve seen people say that they had to downgrade a python version for it to work. Maybe 3.12 is too new?
- As you saw I didn’t install ROOT from the github page, but I’ve seen some instructions saying to do it from there.
Thank you so much for taking the time to read this, I’m so sorry that it ended up being so long. Any help would be greatly appreciated.