I’m on windows with VC++ 7.1. I built ROOT 5.14d myself on my windows box against Python 2.5. The compilation seemed to go just fine, and I have libPyRoot.dll and libPyRoot.lib in the bin and lib directories. A problem occurs if I try to import ROOT into python:
C:>set PYTHONPATH=%ROOTSYS%\bin;%ROOTSYS%\lib
C:>python %ROOTSYS%\tutorials\pyroot\demo.py
Traceback (most recent call last):
File “C:\heather\glast\extlib\ROOT\v5.14.00d\vc8\tutorials\pyroot\demo.py”, line 2, in
import ROOT
File “C:\heather\glast\extlib\ROOT\v5.14.00d\vc8\bin\ROOT.py”, line 83, in
import libPyROOT as _root
ImportError: No module named libPyROOT
I’ve gone back to the binary distribution of ROOT v5.14 for windows and Python 2.4 and trying the same experiment, the demos start up just fine. Is there something more I should do beyond enabling python during my ROOT build? Or is there something particularly wrong with trying to go with Python 2.5 on windows?
staring at this for a bit (I have no Windows box to check), but is it really so that the libs that were built are called “libPyRoot.dll” and “libPyRoot.lib”? I know that the Windows filesystem per se is not case sensitive, but modern Windows OSes are case-preserving, no? If so, then the case will matter to python. Can you verify and rename if needed, see what it does? Thanks.
Thanks, unfortunately I was displaying my Windows-centric lack of concern for capitalization in my post. On my machine, the libraries really are libPyROOT as they should be.
o) is the ‘vc8’ bit in the traceback (in %ROOTSYS%) correct? I.e. are you selecting the new build or the p2.4 install?[/quote]
ROOTSYS is set correctly - I tried on purpose to run Python 24 against my libPyRoot built against Python 2.5 - and python is quite clear when one is trying to load a library built against the wrong version of python.
o) is libPyROOT.dll readable?
yes
o) does dumpobj (or whichever the correct tool is on Windows) report missing symbols/libraries for libPyROOT.dll?
I used dependency walker - and that checked out just fine.
o) is “C:/Python25/bin” part of %PATH%?
Yes
So I went back and rebuilt ROOT v5.14e against Python 2.4.4 on my machine - and that turns out just fine. I can start up python and get demo.py to run. I then went and re-installed Python 2.5.1, fixed up my environment to use it appropriately, restarted the machine, and then rebuilt ROOT v5.14e from scratch. I also modified the path, so that no special characters appears in my ROOTSYS path at all. And when I go to load libPyROOT using Python 2.5.1 - I receive the same error as before.
So I’m wondering - has anyone out there built some version of ROOT v5.14 against Python 2.5 on Windows and gotten it to work?
Maybe I could request that ROOT.py be updated in CVS (if it has not been already) so that future python 2.5 users on windows do not have to pull out their hair