Hi all,
hsimple.py doesn’t run on my WinXp notebook:
[quote] C:\root\tutorials\pyroot>python hsimple.py
Traceback (most recent call last):
File “hsimple.py”, line 13, in
from ROOT import TCanvas, TFile, TProfile, TNtuple, TH1F, TH2F
File “C:\root\bin\ROOT.py”, line 83, in
import libPyROOT as _root
ImportError: No module named libPyROOT[/quote]
So I modified ROOT.py:
[code]— ROOT.py.orig 2006-12-08 08:45:58.000000000 +0900
+++ ROOT.py 2006-12-27 23:35:02.940800000 +0900
@@ -21,6 +21,7 @@
system and interpreter setup ------------------------------------------------
import os, sys, time
import string as pystring
+import imp
there’s no version_info in 1.5.2
if sys.version[0:3] < ‘2.2’:
@@ -80,6 +81,9 @@
dlflags = sys.getdlopenflags()
sys.setdlopenflags( 0x100 | 0x2 ) # RTLD_GLOBAL | RTLD_NOW
+if pystring.find( sys.platform, ‘win32’) == 0:
- dllpath = os.path.join( os.getenv(‘ROOTSYS’), ‘bin’, ‘libPyROOT.dll’)
- imp.load_dynamic(‘libPyROOT’, dllpath)
import libPyROOT as _root
reset dl flags if needed
[/code]
and then python.exe complained that it couldn’t find python24.dll.
After installing python-2.4.4.msi, it runs ok with the above modification.
What’s wrong with my windoze root/python installation?
Are there any better ways to workaround?
Yours,
Kazuyoshi
p.s. the followings are my personal env.vars setting relevant to root/python:
INCLUDE: %ROOTSYS%\include;%MSVCDIR%\include
LIB: %ROOTSYS%\lib;%MSVCDIR%\lib
MSVCDIR: C:\msvc
PATH: %ROOTSYS%\bin;%PYTHONDIR%;%MSVCDIR%\bin;%MSVCDIR%\dll;C:\Program Files\gawk-mbcs-win32-20051223;C:\gs\gs8.54\bin;C:\gs\gs8.54\lib
PYTHONDIR: C:\Python25
PYTHONHOME: C:\Python25
PYTHONPATH: %ROOTSYS%\bin;%ROOTSYS%\lib
ROOTSYS: C:\root