Need help with the installation process please

ROOT Version: root_v6.24.06.win32.vc16
Platform: Win 10 - Family edition x64
Compiler: not sure


Hi,

I’m a pure newbie with Root.

I’d like to install Root and to later install Pyroot to be able to use Python with Root.

I’ve followed the steps described here : (can’t insert links) : root.cern dot install

  1. Installed the required dependencies listed here : root.cern slash install slash dependencies
  • Cmake v 3.21.2 . msi (Windows x64 Installer)
  • Microsoft Visual C++ (Visual Studio for Windows)
  • Python 3.9
  1. Installed the Root software [root_v6.24.06.win32.vc16.exe]
    from here : root dot cern slash download slash root_v6.24.06.win32.vc16.exe

  2. Unpacked the archive

And now I’m stuck, I don’t understand what the 4th step means, what I’m supposed to do :

“Add the ROOT libraries and executables to your environment by sourcing the appropriate thisroot.* script. These setup scripts can be found in the ROOT binary release, in the bin directory.”

Thanks for your assistance.

Sophie

on Linux this means executing the command:

$ source root/bin/thisroot.sh

But you are on Windows. @bellenot will tell you what is the equivalent.
And may be we need to update the install page for windows…

Open a x86 Native Tools Command Prompt for VS 2019, and execute thisroot.bat which is in root\bin. For example:

**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.11.3
** Copyright (c) 2021 Microsoft Corporation
**********************************************************************
[vcvarsall.bat] Environment initialized for: 'x86'

C:\Users\bellenot>c:\root\bin\thisroot.bat

C:\Users\bellenot>

Then you can start root:

C:\Users\bellenot>root
   ------------------------------------------------------------------
  | Welcome to ROOT 6.25/01                        https://root.cern |
  | (c) 1995-2021, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for win32 on Sep 20 2021, 11:34:39                         |
  | From heads/master@v6-25-01-1903-g6928212418                      |
  | With MSVC 19.29.30133.0                                          |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q'       |
   ------------------------------------------------------------------

root [0]

BTW, the Installing ROOT page has been updated

Hi !

Thank you very much for your quick reply.
I followed your steps, and after I entered the cmd, I get :

RegOpenKeyEx(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\$VERSION\InstallationFolder): returned 2: The specified file is not found
RegOpenKeyEx(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots\KitsRoot10): returned 2: The specified file is not found
input_line_1:1:10: fatal error: 'new' file not found
#include <new>
         ^~~~~
Replaced symbol atexit cannot be found in JIT!
Replaced symbol at_quick_exit cannot be found in JIT!
Replaced symbol __dllonexit cannot be found in JIT!
Replaced symbol _onexit cannot be found in JIT!
input_line_3:37:10: fatal error: 'string' file not found
#include <string>
         ^~~~~~~~
   ------------------------------------------------------------------
  | Welcome to ROOT 6.24/06                         |
  | (c) 1995-2021, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for win32 on Sep 02 2021, 14:20:23                         |
  | From tags/v6-24-06@v6-24-06                                      |
  | With MSVC 19.23.28107.0                                          |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q'       |
   ------------------------------------------------------------------

input_line_7:1:10: fatal error: 'iostream' file not found
#include <iostream>

And also, when I enter “import root” in the Python 3.9 cmd panel, I get

"Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'root'"

Any help, please ? :-s

Please start from a x86 Native Tools Command Prompt for VS 2019, as it is now described in the Installing ROOT page

Hi,

I might be mistaken, but I think that I did start from a x86 Native Tools Command Prompt for VS 2019

as I opened cmd and entered : %comspec% /k “C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\VsDevCmd.bat”

then got this message :
** Visual Studio 2019 Developer Command Prompt v16.11.3
** Copyright (c) 2021 Microsoft Corporation

Well, that works for me:

Microsoft Windows [Version 10.0.19042.1237]
(c) Microsoft Corporation. All rights reserved.

C:\Users\bellenot>%comspec% /k "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\VsDevCmd.bat"
**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.11.3
** Copyright (c) 2021 Microsoft Corporation
**********************************************************************

C:\Users\bellenot>C:\root\bin\thisroot.bat

C:\Users\bellenot>root
   ------------------------------------------------------------------
  | Welcome to ROOT 6.24/06                        https://root.cern |
  | (c) 1995-2021, The ROOT Team; conception: R. Brun, F. Rademakers |
  | Built for win32 on Sep 02 2021, 14:20:23                         |
  | From tags/v6-24-06@v6-24-06                                      |
  | With MSVC 19.23.28107.0                                          |
  | Try '.help', '.demo', '.license', '.credits', '.quit'/'.q'       |
   ------------------------------------------------------------------

root [0]

Okay, I’m trying to install root on another computer.
I will keep you updated.

In the meantime, I would be very interested to know why I get these two error messages

RegOpenKeyEx(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows$VERSION\InstallationFolder): returned 2: The specified file is not found

and

RegOpenKeyEx(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Kits\Installed Roots\KitsRoot10): returned 2: The specified file is not found

Thanks again for your assistance.

Usually these messages appear when there is no Windows 10 SDK (coming with Visual Studio) installed on the system. You installed Visual Studio, right? Did you select the “Desktop development with C++” option when installing Visual Studio? (the Windows 10 SDK is part of it)

No, I didn’t install it on my computer.
I understand now, thanks a lot !

1 Like

So I followed your advices, and I was able to install ROOT.
Thank you very much for your help :slight_smile:

Now, the next step that I would like to achieve is to install PyROOT.

So I launched a python prompt, and wrote impot ROOT

But it says
Traceback (most recent call last):
File " , line 1, in
"ModuleNotFoundError: No module named ‘ROOT’

Did you follow the same procedure?

Microsoft Windows [Version 10.0.19041.1237]
(c) Microsoft Corporation. All rights reserved.

C:\Users\bellenot>%comspec% /k "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\Tools\VsDevCmd.bat"
**********************************************************************
** Visual Studio 2019 Developer Command Prompt v16.4.5
** Copyright (c) 2019 Microsoft Corporation
**********************************************************************

C:\Users\bellenot>C:\root\bin\thisroot.bat

C:\Users\bellenot>python
Python 3.9.6 (tags/v3.9.6:db3ff76, Jun 28 2021, 15:04:37) [MSC v.1929 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import ROOT
Traceback (most recent call last):
  File "C:\root\bin\cppyy\__init__.py", line 60, in <module>
    importlib.import_module(libcppyy_mod_name)
  File "C:\Python39-32\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'libcppyy3_9'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\root\bin\ROOT\__init__.py", line 22, in <module>
    import cppyy
  File "C:\root\bin\cppyy\__init__.py", line 62, in <module>
    raise ImportError(
ImportError: Failed to import libcppyy3_9. Please check that ROOT has been built for Python 3.9
>>>

As you can see in this example, it finds ROOT, but the Python version doesn’t match, so make sure also to have installed Python 3.8 (32 bit)

Hi !

Thanks a lot !
I uninstalled python v 3.9 , and installed Python 3.8 instead, and now it seems to be working perfectly fine.

Thank you very much for having taken the time to help me :slight_smile:

Sofia

1 Like

You’re very welcome! Glad to see it’s fixed :slight_smile: