Cling kernel doesn't work for jupyter on Windows

It seems that so many people have problems to installing cling on Windows platform, so do I.

When executing root --notebook, it firstly throws FileNotFoundError for missing python3.11. I quickly realized that there’s only python.exe in my environment variables, so I manually create a symbolic link python3.11 that points to python.exe.

[I 2024-09-13 16:43:43.626 ServerApp] Connecting to kernel c0e6343f-1efa-4184-94a0-f3d5d637bded.

[E 2024-09-13 16:43:48.443 ServerApp] Failed to run command:

    ['python3.11', '-m', 'JupyROOT.kernel.rootkernel', '-f', 'C:\\Users\\Yaner\\AppData\\Roaming\\jupyter\\runtime\\kernel-f35c46e4-b961-48df-8cc7-c4d310b1add2.json']
$ New-Item -ItemType SymbolicLink -Path ./python3.11 -Value .\python.exe

But a new problem comes up. I select the ROOT kernel in jupyter notebook’s kernels list, and another error shows:

Traceback (most recent call last):
  File "<frozen runpy>", line 189, in _run_module_as_main
  File "<frozen runpy>", line 112, in _get_module_details
  File "C:\ToolsForEnvironmentPath\root\bin\JupyROOT\__init__.py", line 15, in <module>
    from JupyROOT.helpers import utils
  File "C:\ToolsForEnvironmentPath\root\bin\JupyROOT\helpers\utils.py", line 32, in <module>
    import ROOT
  File "C:\ToolsForEnvironmentPath\root\bin\ROOT\__init__.py", line 25, in <module>
    import cppyy
  File "C:\ToolsForEnvironmentPath\root\bin\cppyy\__init__.py", line 81, in <module>
    from ._cpython_cppyy import *
  File "C:\ToolsForEnvironmentPath\root\bin\cppyy\_cpython_cppyy.py", line 22, in <module>
    import libcppyy as _backend
ImportError: DLL load failed while importing libcppyy: Can't find module.(找不到指定的模块。)

IDK what should I do next. I would appreciate it that if someone could help me.

Additional Context

kernel directory:

(base) PS C:\tools\root\bin\JupyROOT> tree /F
C:.
│  __init__.py
│
├─helpers
│  │  cppcompleter.py
│  │  handlers.py
│  │  utils.py
│  │  __init__.py
│  │
│  └─__pycache__
│          cppcompleter.cpython-311.opt-1.pyc
│          cppcompleter.cpython-311.pyc
│          handlers.cpython-311.opt-1.pyc
│          handlers.cpython-311.pyc
│          utils.cpython-311.opt-1.pyc
│          utils.cpython-311.pyc
│          utils.cpython-312.pyc
│          __init__.cpython-311.opt-1.pyc
│          __init__.cpython-311.pyc
│          __init__.cpython-312.pyc
│
├─html
│  │  cpphighlighter.py
│  │  __init__.py
│  │
│  └─__pycache__
│          cpphighlighter.cpython-311.opt-1.pyc
│          cpphighlighter.cpython-311.pyc
│          __init__.cpython-311.opt-1.pyc
│          __init__.cpython-311.pyc
│
├─kernel
│  │  rootkernel.py
│  │  utils.py
│  │  __init__.py
│  │
│  ├─magics
│  │  │  cppmagic.py
│  │  │  jsrootmagic.py
│  │  │  __init__.py
│  │  │
│  │  └─__pycache__
│  │          cppmagic.cpython-311.opt-1.pyc
│  │          cppmagic.cpython-311.pyc
│  │          jsrootmagic.cpython-311.opt-1.pyc
│  │          jsrootmagic.cpython-311.pyc
│  │          __init__.cpython-311.opt-1.pyc
│  │          __init__.cpython-311.pyc
│  │
│  └─__pycache__
│          rootkernel.cpython-311.opt-1.pyc
│          rootkernel.cpython-311.pyc
│          utils.cpython-311.opt-1.pyc
│          utils.cpython-311.pyc
│          __init__.cpython-311.opt-1.pyc
│          __init__.cpython-311.pyc
│
├─magics
│  │  cppmagic.py
│  │  jsrootmagic.py
│  │  __init__.py
│  │
│  └─__pycache__
│          cppmagic.cpython-311.opt-1.pyc
│          cppmagic.cpython-311.pyc
│          jsrootmagic.cpython-311.opt-1.pyc
│          jsrootmagic.cpython-311.pyc
│          __init__.cpython-311.opt-1.pyc
│          __init__.cpython-311.pyc
│
└─__pycache__
        __init__.cpython-311.opt-1.pyc
        __init__.cpython-311.pyc
        __init__.cpython-312.pyc

pip list:

(base) PS C:\Users\Yaner\Desktop\Thoughts> pip list
Package                   Version
------------------------- --------------
anaconda-anon-usage       0.4.4
anyio                     4.4.0
archspec                  0.2.3
argon2-cffi               23.1.0
argon2-cffi-bindings      21.2.0
arrow                     1.3.0
asttokens                 2.4.1
async-lru                 2.0.4
attrs                     24.2.0
babel                     2.16.0
beautifulsoup4            4.12.3
bleach                    6.1.0
boltons                   23.0.0
Brotli                    1.0.9
certifi                   2024.8.30
cffi                      1.17.1
charset-normalizer        3.3.2
colorama                  0.4.6
comm                      0.2.2
conda                     24.7.1
conda-content-trust       0.2.0
conda-libmamba-solver     24.7.0
conda-package-handling    2.3.0
conda_package_streaming   0.10.0
cryptography              42.0.5
debugpy                   1.8.5
decorator                 5.1.1
defusedxml                0.7.1
distro                    1.9.0
executing                 2.1.0
fastjsonschema            2.20.0
fqdn                      1.5.1
frozendict                2.4.2
h11                       0.14.0
httpcore                  1.0.5
httpx                     0.27.2
idna                      3.8
ipykernel                 6.29.5
ipython                   8.27.0
ipywidgets                8.1.5
isoduration               20.11.0
jedi                      0.19.1
Jinja2                    3.1.4
json5                     0.9.25
jsonpatch                 1.33
jsonpointer               3.0.0
jsonschema                4.23.0
jsonschema-specifications 2023.12.1
jupyter                   1.1.1
jupyter_client            8.6.2
jupyter-console           6.6.3
jupyter_core              5.7.2
jupyter-events            0.10.0
jupyter-lsp               2.2.5
jupyter_server            2.14.2
jupyter_server_terminals  0.5.3
jupyterlab                4.2.5
jupyterlab_pygments       0.3.0
jupyterlab_server         2.27.3
jupyterlab_widgets        3.0.13
libmambapy                1.5.8
MarkupSafe                2.1.5
matplotlib-inline         0.1.7
menuinst                  2.1.2
metakernel                0.30.2
mistune                   3.0.2
nbclient                  0.10.0
nbconvert                 7.16.4
nbformat                  5.10.4
nest-asyncio              1.6.0
notebook                  7.2.2
notebook_shim             0.2.4
overrides                 7.7.0
packaging                 24.1
pandocfilters             1.5.1
parso                     0.8.4
pexpect                   4.9.0
pip                       24.2
platformdirs              4.3.2
pluggy                    1.0.0
prometheus_client         0.20.0
prompt_toolkit            3.0.47
psutil                    6.0.0
ptyprocess                0.7.0
pure_eval                 0.2.3
pycosat                   0.6.6
pycparser                 2.22
Pygments                  2.18.0
PySocks                   1.7.1
python-dateutil           2.9.0.post0
python-json-logger        2.0.7
pywin32                   306
pywinpty                  2.0.13
PyYAML                    6.0.2
pyzmq                     26.2.0
referencing               0.35.1
requests                  2.32.3
rfc3339-validator         0.1.4
rfc3986-validator         0.1.1
rpds-py                   0.20.0
ruamel.yaml               0.17.21
Send2Trash                1.8.3
setuptools                74.1.2
six                       1.16.0
sniffio                   1.3.1
soupsieve                 2.6
stack-data                0.6.3
terminado                 0.18.1
tinycss2                  1.3.0
tornado                   6.4.1
tqdm                      4.66.4
traitlets                 5.14.3
truststore                0.8.0
types-python-dateutil     2.9.0.20240906
uri-template              1.3.0
urllib3                   2.2.3
uv                        0.4.9
wcwidth                   0.2.13
webcolors                 24.8.0
webencodings              0.5.1
websocket-client          1.8.0
wheel                     0.43.0
widgetsnbextension        4.0.13
win-inet-pton             1.1.0
zstandard                 0.22.0

Hi,

Thanks for the question and welcome to the ROOT Community!

Let me add our Windows expert in the loop @bellenot .

I am not sure whether this is a problem with the Python interface: are you able to import the ROOT module from Python?

Cheers,
Danilo

Which version of ROOT? How did you install (from source, binary)? If binary, which exact file did you download?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.