How to Install CERN ROOT on Windows

If you are a student or researcher in nuclear or high-energy physics, you will eventually need to use CERN ROOT — the powerful open-source data analysis framework developed at the European Organization for Nuclear Research (CERN). ROOT is used for histogramming, curve fitting, event analysis, detector simulation, and visualization of experimental data.
🧠 What You’ll Need
  • Windows 10 or Windows 11 (64-bit)
  • At least 5–10 GB of free disk space
  • Administrator privileges on your PC
  • Stable internet connection
🧩 Step 1 — Install Microsoft Visual Studio Build Tools
ROOT on Windows requires Microsoft’s C++ toolchain (MSVC).
  1. Go to Visual Studio Downloads.
  2. Find Tools for Visual Studio → Build Tools for Visual Studio 2022.
  3. Run the installer and choose Desktop development with C++.
  4. Ensure MSVC, Windows SDK, and CMake tools are selected, then install.
🐍 Step 2 — Install Python 3.11 (64-bit)
  1. Download from python.org.
  2. Run the installer and check Add Python 3.11 to PATH.
  3. Verify installation:
py -3.11
You should see a Python 3.11 prompt.
📦 Step 3 — Download CERN ROOT for Windows
  1. Go to root.cern/install.
  2. Download the version matching Python 3.11 (example): root_v6.36.04.win64.python311.vc17.zip
🗂️ Step 4 — Extract ROOT to C:\root
  1. Create a folder C:\root.
  2. Extract the downloaded ZIP to C:\root.
  3. The final path should look like C:\root\root\bin.
⚙️ Step 5 — Configure the ROOT Environment
Before running ROOT, you must load its environment variables:
cd C:\root\root\bin
thisroot.bat
Now you can use ROOT from Python.
🧪 Step 6 — Test ROOT with Python (PyROOT)
After running thisroot.bat, start Python:
py -3.11
Then type the following code to check that ROOT is working:
import ROOT
print(ROOT.__version__)
If you see a version number like 6.36.04, the setup is correct.
📊 Step 7 — Create and Save Your First Histogram
Now try a small PyROOT script:
import ROOT
print(ROOT.__version__)

h = ROOT.TH1F("h", "Gaussian; X; Counts", 50, -3, 3)
for _ in range(10000):
    h.Fill(ROOT.gRandom.Gaus())

c = ROOT.TCanvas("c", "Test Canvas", 800, 600)
h.Draw()
c.SaveAs("test_hist.png")
This will generate a Gaussian histogram and save it as test_hist.png in your working directory. The histogram shown in the picture below is what you will see.

🚀 Step 8 — (Optional) Create a ROOT Shell Shortcut
  1. Right-click your Desktop → New → Shortcut
  2. Paste this command:
C:\Windows\System32\cmd.exe /k "C:\root\root\bin\thisroot.bat"

Name it ROOT Shell. Double-click it to open a command prompt with ROOT preloaded.

🧭 Troubleshooting
  • ImportError: DLL load failed while importing libcppyy — Python version mismatch. Install the exact version listed in the ROOT filename (e.g., python311 → Python 3.11).
  • If import ROOT fails, make sure you ran thisroot.bat first.
  • If plots don’t display, ensure you are running in an environment that supports GUI (not a headless terminal).
📚 Next Steps
  • Understanding TCanvas and TH1 objects
  • Fitting functions (Gaussian, Exponential)
  • Working with TFile and TTree
  • Using RDataFrame for analysis

References & Further Reading

  1. CERN ROOT — Official Website: https://root.cern/
  2. Brun, R. & Rademakers, F. (1997). “ROOT – An Object Oriented Data Analysis Framework.” Nuclear Instruments and Methods in Physics Research A, 389(1–2), 81–86. DOI: 10.1016/S0168-9002(97)00048-X
  3. CERN Documentation: ROOT User Manual and Tutorials
  4. TMVA Toolkit for Multivariate Data Analysis: https://root.cern/manual/tmva/
  5. GEANT4 Collaboration. “GEANT4 – A Simulation Toolkit.” Nuclear Instruments and Methods in Physics Research A, 506(3), 250–303 (2003). DOI: 10.1016/S0168-9002(03)01368-8
  6. FLUKA Simulation Package — Official CERN Page: https://fluka.cern/
  7. CERN Open Data Portal — Public Datasets for Education and Research: https://opendata.cern.ch/
  8. CERN Scientific Computing Documentation: https://home.cern/science/computing
  9. C++ ROOT Tutorials for Beginners (Official GitHub Examples): https://github.com/root-project/root/tree/master/tutorials

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top