No, you really need to call source /home/sayang/root-6.24.04/bin/thisroot.sh as per point 4 of the instructions at /home/sayang/root-6.24.04 . That command sets all required environment variables for that shell session.
I have read the link given by you and also followed a question related to pythonpath in the newbie section
In the above question it has been told to export pythonpath in this way to avoid import error:
export PYTHONPATH=$(root-config --libdir)
But even after doing this my import error is still coming and I have also called
source /home/sayang/root-6.24.04/bin/thisroot.sh after exporting pythonpath based on the answer given in the above question. Thanks!
You have to make sure that ROOT was built with PyROOT support, i.e. check in the output of root-config --features. If you cannot find pyroot in the output, you should build ROOT specifying:
$ cmake -Dpyroot=ON ...
After enabling pyroot, as @eguiraud said, thisroot.sh should take care of setting $PYTHONPATH. Let us know if that’s not the case.
sayang@DESKTOP-IFS80HM:~$ root-config --has-python
no
Although I have installed Python but still my python binding is missing in root-config --features. After seeing another one facing issue like me in this following link
I realized that I need to rebuild root from scratch. Does that mean I should reinstall ROOT or there is any other way.
Actually I followed this video to install root through WSL Installing CERN ROOT in Windows with WSL - YouTube
Thanks!
Yes, if you installed ROOT building from sources, you need to rebuild (+ install) including PyROOT. To do so, be sure to include -Dpyroot=ON in the cmake command line, e.g.
$ cmake -Dpyroot=ON ...
Reusing the same build directory should (hopefully) work for an incremental build, which saves some compilation time.
Yes, if you installed ROOT building from sources, you need to rebuild (+ install) including PyROOT. To do so, be sure to include -Dpyroot=ON in the cmake command line, e.g.
No , I haven’t build from the sources from github. Is there any way to include python bindings or pyroot root-config --features by providing any one or two line command in wsl ubuntu terminal?
I actually followed this video to install root which doesn’t include installing pyroot and python
What is shown in the video is how to build and install ROOT from sources. Typically, this is for advanced users only (or for some specific cases). The recommended way of installing ROOT is either through package managers or Conda, as seen in the Installation guide.
That said, now that you already built succesfully ROOT from sources, I would recommend to perform the following steps from the buildroot/ directory:
Hi @jalopezg ,
I have followed the steps successfully as told by you. Still after writing root-config --features it is not showing Python or PyRoot. Is there any one or two line command to include python in root-config --features?
ImportError: Failed to import libcppyy2_7. Please check that ROOT has been built for Python 2.7
All the .C files are running successfully but whenever I try to compile .py files for e.g rf204_extrangefit.py it is showing the import error but now its not showing “No module names ROOT”. Thanks for your help again! its started to work properly but still not able to run .py files in tutorials/roofit.
Thanks, pyroot is now present in root -config–features but not python. Also I would like to know whether I can solve this error after including Python 2.7 in root -config–features
ImportError: Failed to import libcppyy2_7. Please check that ROOT has been built for Python 2.7
Hi @Wile_E_Coyote ,
I am using the same python version as it is in my root binaries which were built and pyroot is also present.(3.8.10 in ROOT 6).
In spite of all this I got this error when running
Hi @Wile_E_Coyote!
Thanks a lot for your help, I have been stuck here for months. If you can also share some advice on how to get started with root for beginners it will be grateful. Thanks!