Python3 and ROOT 6.23/01

Dear Etejedor,

Thank you very much for your quick response. But, please note that I am using the fix location type ROOT installation, for which the installation guide says

While to use the fix location installation you do not need to set any environment to run root.

Am I right? So, where is the problem?

Regards,

Ajay

If you install on /opt/root , the Python interpreter will not find the ROOT python module unless your source the environment script of ROOT.

Perhaps @oshadura knows more details about the fixed location type installation?

Hi @ajaydeo,

if you install in system directories, then it will work without setting adding extra environment variables or sourcing thisroot.sh. Otherwise, you need to have setup at least PYTHONPATH…

Thank you very much for the help.

I have sourced thisroot.sh. Now, I no more get the error. But, I am NOT able to run almost all the python tutorial in the pyroot directory. Below, I mention some of the problems:

1. python demo.py gives the demo GUI with buttons, but not even a single button is clickable.
2. python demoshelp.py and python zdemo.py just flashes some windows momentarily which I am not able to see.

Please suggest.

Regards,

Ajay

@oshadura @etejedor
Today morning, I downloaded latest available root-master.zip from https://github.com/root-project/root.

Initially, I compiled it with python2. Then all the tutorials in the pyroot directory run without any problem.

Followed by this, I again compiled it with python3. I can see some improvements to the earlier version. Now, when I run python3 demo.py, I get the vertical bar with several buttons, which, this time, I am able to click. But, when I click on all the buttons, I get the following error; except browser button:

$ python demo.py 
enter "q" to quit: Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'execfile' is not defined

This error wasn’t there when I used python2

IMPORTANT NOTE:

I have to manually copy libGLEW.so from /opt/root/lib to /opt/root/lib/root. Otherwise, I get complaint/error while using OpenGL viewer. Will it be possible for the ROOT team to rectify this problem?

Regards,

Ajay

Dear Ajay,

Indeed, the demo.py tutorial that you mention uses execfile, which is a feature no longer provided by Python3, so right now it is only usable from Python2. I guess we did not notice about this tutorial earlier because it is interactive and thus does not run in our nightly tests. We’ll fix that!

@ajaydeo I am trying now to reproduce problem with libGLEW, thanks for report!

@ajaydeo other question can you check please if you have this commit in your ROOT https://github.com/root-project/root/commit/ff634afdb72acef3458c588a5bb6655d4016d400

@oshadura @etejedor
I now have

root [0] gROOT->GetGitCommit()
(const char *) "v6-23-01-335-gffa7013ea6"
root [1] 

compiled with python2 (2.7.18) using

cmake ../root-6.23.01 -DCMAKE_INSTALL_PREFIX=/opt/root -Dgnuinstall=ON -Droofit=ON -Drpath=ON -Dsoversion=ON -Dpython=ON -DPYTHON_EXECUTABLE=/usr/bin/python2 -Dcling=ON

As mentioned by @Wile_E_Coyote in his Python in ROOT 6.22.99 post, some macros in the pyroot directory work some don’t. I feel that there is a need to seriously check the compatibility of those macros. However, in my case all the macros in demo.py work except framework.py, first.py, file.py, fildir.py, tree.py, and rootmarks.py, which give errors similar to the one below

Traceback (most recent call last):
  File "<string>", line 1, in <module>
IOError: [Errno 2] No such file or directory: 'file.py'

Also, when I run python2 demoshelp.py as standalone macro, it runs and flashes the canvas and vanishes quickly, even before I see what is there on the canvas! However, when I run it through python2 demo.py it stays there.

Further, root-config --config | grep PYTHON doesn’t return anything!
I think, PYTHON_INCLUDE_DIR, PYTHON_LIBRARY, PYTHON_LIBRARY_RELEASE in addition to the PYTHONPATH should be automatically set since we compile ROOT with -DCMAKE_INSTALL_PREFIX set.

May I request you to please look into this.

Regards,

Ajay

Hello Ajay,

Regarding your comments on the Python variables to be shown by root-config and regarding the tutorials, I suggest we follow up on that discussion in Wile’s post.

For the tutorials issue, we now have:

https://sft.its.cern.ch/jira/browse/ROOT-10844

btw, I checked with latest master branch of root.git and I have libGLEW installed in lib directory.

I know it is there under lib. But, shouldn’t it be there in lib/root for OpenGL viewer?
I suggest you to run a code and try to view the O/P using OpenGL viewer, without having libGLEW in lib/root (and without libGLEW being provided by the operating system).

Could you please open Jira issue (s) about GLEW and Python variables? It will be easier to invite other experts to take a look.

p.s. About GLEW, I tested with root viewer3DMaster.C and everything works smothly. Remark: I don’t have Glew installed so I am using ROOT builtin GLEW.

I don’t have the Jira account. Also, don’t know how to open the ticket on Jira!

Update:

@ajaydeo we are working on a fix of python variables issue.
About GLEW it is shipped in lib directory and used by ROOT from there. There should not be a
any lib/root, if you have it please print here what do you have there?

See “IMPORTANT NOTE:” in:

1 Like

In /opt/root/lib I have:
libGLEW.so and root directory.
---------
In /opt/root/lib/root I have:

ASImageGui.pcm                          libmap2Dict.so                       libTreePlayer.so.6.23.01
ASImage.pcm                             libmap2Dict.so.6.23                  libTree.so
_Builtin_intrinsics.pcm                 libmap2Dict.so.6.23.01               libTree.so.6.23
_Builtin_stddef_max_align_t.pcm         libmapDict.rootmap                   libTree.so.6.23.01
can2root_utils_cc_ACLiC_dict_rdict.pcm  libmapDict.so                        libTreeViewer.so
Cling_Runtime_Extra.pcm                 libmapDict.so.6.23                   libTreeViewer.so.6.23
Cling_Runtime.pcm                       libmapDict.so.6.23.01                libTreeViewer.so.6.23.01
cmake                                   libMathCore.so                       libUnfold.so
cmdLineUtils.py                         libMathCore.so.6.23                  libUnfold.so.6.23
cmdLineUtils.pyc                        libMathCore.so.6.23.01               libUnfold.so.6.23.01
cmdLineUtils.pyo                        libMathMore.so                       libunordered_mapDict.rootmap
Core.pcm                                libMathMore.so.6.23                  libunordered_mapDict.so
cppyy                                   libMathMore.so.6.23.01               libunordered_mapDict.so.6.23
cppyy_backend                           libMatrix.so                         libunordered_mapDict.so.6.23.01
EG.pcm                                  libMatrix.so.6.23                    libunordered_multimapDict.rootmap
Eve.pcm                                 libMatrix.so.6.23.01                 libunordered_multimapDict.so
FitPanel.pcm                            libMinuit.so                         libunordered_multimapDict.so.6.23
Foam.pcm                                libMinuit.so.6.23                    libunordered_multimapDict.so.6.23.01
Fumili.pcm                              libMinuit.so.6.23.01                 libunordered_multisetDict.rootmap
Gdml.pcm                                libMLP.so                            libunordered_multisetDict.so
Ged.pcm                                 libMLP.so.6.23                       libunordered_multisetDict.so.6.23
Genetic.pcm                             libMLP.so.6.23.01                    libunordered_multisetDict.so.6.23.01
GenVector.pcm                           libmultimap2Dict.rootmap             libunordered_setDict.rootmap
GeomBuilder.pcm                         libmultimap2Dict.so                  libunordered_setDict.so
GeomPainter.pcm                         libmultimap2Dict.so.6.23             libunordered_setDict.so.6.23
Geom.pcm                                libmultimap2Dict.so.6.23.01          libunordered_setDict.so.6.23.01
Gpad.pcm                                libmultimapDict.rootmap              libvalarrayDict.rootmap
Graf3d.pcm                              libmultimapDict.so                   libvalarrayDict.so
Graf.pcm                                libmultimapDict.so.6.23              libvalarrayDict.so.6.23
GuiBld.pcm                              libmultimapDict.so.6.23.01           libvalarrayDict.so.6.23.01
GuiHtml.pcm                             libMultiProc.so                      libvdt.so
Gui.pcm                                 libMultiProc.so.6.23                 libvectorDict.rootmap
Gviz3d.pcm                              libMultiProc.so.6.23.01              libvectorDict.so
GX11.pcm                                libmultisetDict.rootmap              libvectorDict.so.6.23
GX11TTF.pcm                             libmultisetDict.so                   libvectorDict.so.6.23.01
HistFactory.pcm                         libmultisetDict.so.6.23              libX3d.so
HistPainter.pcm                         libmultisetDict.so.6.23.01           libX3d.so.6.23
Hist.pcm                                libNet.so                            libX3d.so.6.23.01
Html.pcm                                libNet.so.6.23                       libXMLIO.so
Imt.pcm                                 libNet.so.6.23.01                    libXMLIO.so.6.23
JsMVA                                   libNetxNG.so                         libXMLIO.so.6.23.01
JupyROOT                                libNetxNG.so.6.23                    libXMLParser.so
libASImageGui.so                        libNetxNG.so.6.23.01                 libXMLParser.so.6.23
libASImageGui.so.6.23                   libNetx.so                           libXMLParser.so.6.23.01
libASImageGui.so.6.23.01                libNetx.so.6.23                      libXrdAppUtils.so
libASImage.so                           libNetx.so.6.23.01                   libXrdAppUtils.so.1
libASImage.so.6.23                      libNew.so                            libXrdAppUtils.so.1.0.0
libASImage.so.6.23.01                   libNew.so.6.23                       libXrdBlacklistDecision-4.so
libCling.so                             libNew.so.6.23.01                    libXrdBwm-4.so
libCling.so.6.23                        libPhysics.so                        libXrdCksCalczcrc32-4.so
libCling.so.6.23.01                     libPhysics.so.6.23                   libXrdClient.so
libcomplexDict.rootmap                  libPhysics.so.6.23.01                libXrdClient.so.2
libcomplexDict.so                       libPostscript.so                     libXrdClient.so.2.0.0
libcomplexDict.so.6.23                  libPostscript.so.6.23                libXrdClProxyPlugin-4.so
libcomplexDict.so.6.23.01               libPostscript.so.6.23.01             libXrdCl.so
libCore.so                              libProofBench.so                     libXrdCl.so.2
libCore.so.6.23                         libProofBench.so.6.23                libXrdCl.so.2.0.0
libCore.so.6.23.01                      libProofBench.so.6.23.01             libXrdCryptoLite.so
libc.pcm                                libProofDraw.so                      libXrdCryptoLite.so.1
libcppyy2_7.so                          libProofDraw.so.6.23                 libXrdCryptoLite.so.1.0.0
libcppyy2_7.so.6.23                     libProofDraw.so.6.23.01              libXrdCrypto.so
libcppyy2_7.so.6.23.01                  libProofPlayer.so                    libXrdCrypto.so.1
libcppyy_backend2_7.so                  libProofPlayer.so.6.23               libXrdCrypto.so.1.0.0
libcppyy_backend2_7.so.6.23             libProofPlayer.so.6.23.01            libXrdCryptossl-4.so
libcppyy_backend2_7.so.6.23.01          libProof.so                          libXrdFfs.so
libdequeDict.rootmap                    libProof.so.6.23                     libXrdFfs.so.2
libdequeDict.so                         libProof.so.6.23.01                  libXrdFfs.so.2.0.0
libdequeDict.so.6.23                    libQuadp.so                          libXrdFileCache-4.so
libdequeDict.so.6.23.01                 libQuadp.so.6.23                     libXrdHttp-4.so
libEG.so                                libQuadp.so.6.23.01                  libXrdHttpUtils.so
libEG.so.6.23                           libRCsg.so                           libXrdHttpUtils.so.1
libEG.so.6.23.01                        libRCsg.so.6.23                      libXrdHttpUtils.so.1.0.0
libEve.so                               libRCsg.so.6.23.01                   libXrdN2No2p-4.so
libEve.so.6.23                          libRecorder.so                       libXrdOssSIgpfsT-4.so
libEve.so.6.23.01                       libRecorder.so.6.23                  libXrdPosixPreload.so
libFitPanel.so                          libRecorder.so.6.23.01               libXrdPosixPreload.so.1
libFitPanel.so.6.23                     libRGL.so                            libXrdPosixPreload.so.1.0.0
libFitPanel.so.6.23.01                  libRGL.so.6.23                       libXrdPosix.so
libFoam.so                              libRGL.so.6.23.01                    libXrdPosix.so.2
libFoam.so.6.23                         libRHTTPSniff.so                     libXrdPosix.so.2.0.0
libFoam.so.6.23.01                      libRHTTPSniff.so.6.23                libXrdPss-4.so
libforward_listDict.rootmap             libRHTTPSniff.so.6.23.01             libXrdSec-4.so
libforward_listDict.so                  libRHTTP.so                          libXrdSecgsi-4.so
libforward_listDict.so.6.23             libRHTTP.so.6.23                     libXrdSecgsiAUTHZVO-4.so
libforward_listDict.so.6.23.01          libRHTTP.so.6.23.01                  libXrdSecgsiGMAPDN-4.so
libFTGL.so                              libRint.so                           libXrdSecProt-4.so
libFTGL.so.6.23                         libRint.so.6.23                      libXrdSecpwd-4.so
libFTGL.so.6.23.01                      libRint.so.6.23.01                   libXrdSecsss-4.so
libFumili.so                            libRIO.so                            libXrdSecunix-4.so
libFumili.so.6.23                       libRIO.so.6.23                       libXrdServer.so
libFumili.so.6.23.01                    libRIO.so.6.23.01                    libXrdServer.so.2
libGdml.so                              libRooFitCore.so                     libXrdServer.so.2.0.0
libGdml.so.6.23                         libRooFitCore.so.6.23                libXrdSsi-4.so
libGdml.so.6.23.01                      libRooFitCore.so.6.23.01             libXrdSsiLib.so
libGed.so                               libRooFitMore.so                     libXrdSsiLib.so.1
libGed.so.6.23                          libRooFitMore.so.6.23                libXrdSsiLib.so.1.0.0
libGed.so.6.23.01                       libRooFitMore.so.6.23.01             libXrdSsiLog-4.so
libGenetic.so                           libRooFit.so                         libXrdSsiShMap.so
libGenetic.so.6.23                      libRooFit.so.6.23                    libXrdSsiShMap.so.1
libGenetic.so.6.23.01                   libRooFit.so.6.23.01                 libXrdSsiShMap.so.1.0.0
libGenVector32.rootmap                  libRooStats.so                       libXrdThrottle-4.so
libGenVector.so                         libRooStats.so.6.23                  libXrdUtils.so
libGenVector.so.6.23                    libRooStats.so.6.23.01               libXrdUtils.so.2
libGenVector.so.6.23.01                 libRootAuth.so                       libXrdUtils.so.2.0.0
libGeomBuilder.so                       libRootAuth.so.6.23                  libXrdXml.so
libGeomBuilder.so.6.23                  libRootAuth.so.6.23.01               libXrdXml.so.2
libGeomBuilder.so.6.23.01               libROOTDataFrame.so                  libXrdXml.so.2.0.0
libGeomPainter.so                       libROOTDataFrame.so.6.23             libXrdXrootd-4.so
libGeomPainter.so.6.23                  libROOTDataFrame.so.6.23.01          MathCore.pcm
libGeomPainter.so.6.23.01               libROOTPythonizations2_7.so          MathMore.pcm
libGeom.so                              libROOTPythonizations2_7.so.6.23     Matrix.pcm
libGeom.so.6.23                         libROOTPythonizations2_7.so.6.23.01  Minuit.pcm
libGeom.so.6.23.01                      libROOTTPython.so                    MLP.pcm
libGLEW.so                              libROOTTPython.so.6.23               modules.timestamp
libGpad.so                              libROOTTPython.so.6.23.01            MultiProc.pcm
libGpad.so.6.23                         libROOTVecOps.so                     Net.pcm
libGpad.so.6.23.01                      libROOTVecOps.so.6.23                NetxNG.pcm
libGraf3d.so                            libROOTVecOps.so.6.23.01             Netx.pcm
libGraf3d.so.6.23                       libRSQLite.so                        Physics.pcm
libGraf3d.so.6.23.01                    libRSQLite.so.6.23                   Postscript.pcm
libGraf.so                              libRSQLite.so.6.23.01                ProofBench.pcm
libGraf.so.6.23                         libSessionViewer.so                  ProofDraw.pcm
libGraf.so.6.23.01                      libSessionViewer.so.6.23             Proof.pcm
libGuiBld.so                            libSessionViewer.so.6.23.01          ProofPlayer.pcm
libGuiBld.so.6.23                       libsetDict.rootmap                   Quadp.pcm
libGuiBld.so.6.23.01                    libsetDict.so                        RCsg.pcm
libGuiHtml.so                           libsetDict.so.6.23                   Recorder.pcm
libGuiHtml.so.6.23                      libsetDict.so.6.23.01                RGL.pcm
libGuiHtml.so.6.23.01                   libSmatrix32.rootmap                 RHTTP.pcm
libGui.so                               libSmatrix.so                        RHTTPSniff.pcm
libGui.so.6.23                          libSmatrix.so.6.23                   Rint.pcm
libGui.so.6.23.01                       libSmatrix.so.6.23.01                RIO.pcm
libGviz3d.so                            libSpectrumPainter.so                RooFitCore.pcm
libGviz3d.so.6.23                       libSpectrumPainter.so.6.23           RooFitMore.pcm
libGviz3d.so.6.23.01                    libSpectrumPainter.so.6.23.01        RooFit.pcm
libGX11.so                              libSpectrum.so                       RooStats.pcm
libGX11.so.6.23                         libSpectrum.so.6.23                  ROOT
libGX11.so.6.23.01                      libSpectrum.so.6.23.01               RootAuth.pcm
libGX11TTF.so                           libSPlot.so                          ROOT_Config.pcm
libGX11TTF.so.6.23                      libSPlot.so.6.23                     ROOTDataFrame.pcm
libGX11TTF.so.6.23.01                   libSPlot.so.6.23.01                  ROOT_Foundation_C.pcm
libHistFactory.so                       libSQLIO.so                          ROOT_Foundation_Stage1_NoRTTI.pcm
libHistFactory.so.6.23                  libSQLIO.so.6.23                     ROOT_Rtypes.pcm
libHistFactory.so.6.23.01               libSQLIO.so.6.23.01                  ROOTTPython.pcm
libHistPainter.so                       libSrvAuth.so                        ROOTVecOps.pcm
libHistPainter.so.6.23                  libSrvAuth.so.6.23                   RSQLite.pcm
libHistPainter.so.6.23.01               libSrvAuth.so.6.23.01                SessionViewer.pcm
libHist.so                              libtbbmalloc_proxy.so                Smatrix.pcm
libHist.so.6.23                         libtbbmalloc_proxy.so.2              SpectrumPainter.pcm
libHist.so.6.23.01                      libtbbmalloc.so                      Spectrum.pcm
libHtml.so                              libtbbmalloc.so.2                    SPlot.pcm
libHtml.so.6.23                         libtbb.so                            SQLIO.pcm
libHtml.so.6.23.01                      libtbb.so.2                          std.pcm
libImt.so                               libThread.so                         Thread.pcm
libImt.so.6.23                          libThread.so.6.23                    TMVAGui.pcm
libImt.so.6.23.01                       libThread.so.6.23.01                 TMVA.pcm
libJupyROOT2_7.so                       libTMVAGui.so                        Tree.pcm
libJupyROOT2_7.so.6.23                  libTMVAGui.so.6.23                   TreePlayer.pcm
libJupyROOT2_7.so.6.23.01               libTMVAGui.so.6.23.01                TreeViewer.pcm
liblistDict.rootmap                     libTMVA.so                           Unfold.pcm
liblistDict.so                          libTMVA.so.6.23                      X3d.pcm
liblistDict.so.6.23                     libTMVA.so.6.23.01                   XMLIO.pcm
liblistDict.so.6.23.01                  libTreePlayer.so                     XMLParser.pcm
libmap2Dict.rootmap                     libTreePlayer.so.6.23

Here is thisroot.sh.txt (5.1 KB). Please rename this to thisroot.sh (I am not allowed to upload .sh files!). You can check the content of this file. May be of some help for further investogation of the issue.

The fact that, after “make install”, the " libGLEW" is not found by some ROOT’s libraries may be the same problem as: Jira -> ROOT -> ROOT-10756

Please check my recent post in Different INSTALL-directory structure for different installation methods for possible solution of different directory structure and missing (misplaced) libraries.

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