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.
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…
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.
@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?
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!
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 PYTHONdoesn’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.
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.
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.
@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?
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.