cling icon indicating copy to clipboard operation
cling copied to clipboard

There is cling in $PATH environment,but raise error.

Open jtyoui opened this issue 4 years ago • 0 comments

  • [x] download source https://root.cern.ch/download/cling/cling_2020-11-05_ROOT-ubuntu2004.tar.bz2

Describe the bug

There is cling order and add in $PATH that clingkernel.py not find cling.

This is my environment of Ubuntu system. I am input order (base) root@27390f75d1d3:~# cat ~/.bashrc that terminal see down:

CLANG_PATH=/home/cling
export LIBRARY_PATH=${CLANG_PATH}/lib/:$LIBRARY_PATH
export CPATH=${CLANG_PATH}/include/:$CPATH
export LD_LIBRARY_PATH=${CLANG_PATH}/lib/:$LD_LIBRARY_PATH
export PATH=${CLANG_PATH}/bin:$PATH

start Jupyterlab raise Errors:

File "/opt/conda/lib/python3.8/site-packages/traitlets/config/configurable.py", line 537, in instance
  inst = cls(*args, **kwargs)
File "/home/cling/share/cling/Jupyter/kernel/clingkernel.py", line 105, in __init__
  raise RuntimeError('Cannot find cling in $PATH. No cling, no fun.')
RuntimeError: Cannot find cling in $PATH. No cling, no fun.

what??? Nothing to say I open clingkernel.py that find to report error line in 105

98     def __init__(self, **kwargs):
99         super(ClingKernel, self).__init__(**kwargs)
100         clingInPath = shutil.which('cling')
101         # clingInPath value is None 
102         if not clingInPath:
103             from distutils.spawn import find_executable
104             clingInPath = find_executable('cling')
105         if not clingInPath:
106             raise RuntimeError('Cannot find cling in $PATH. No cling, no fun.')

But~~~~~~ I open python3 terminal:

(base) root@27390f75d1d3:~# python3
Python 3.8.8 | packaged by conda-forge | (default, Feb 20 2021, 16:22:27) 
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import shutil
>>> shutil.which('cling')
'/home/cling/bin/cling'
>>> 

what are fu*k ??

temporary solved: clingInPath = shutil.which('cling') change to clingInPath = "/home/cling/bin/cling" start Jupyter is succeed~~~

jtyoui avatar Apr 30 '21 01:04 jtyoui