Root_open error on Windows 7

I am using Windows 7. Everything I put here is working on linux with the same python and root version. I just need to run it on Windows.

I have installed:

  1. root 5.34/34.
  2. python 2.7
  3. rootpy

It imports ROOT correctly, however, then I try to run my code:

[code]import astropy
import photutils
import ROOT
from rootpy.tree import Tree, TreeModel
from rootpy.tree import IntCol, FloatCol, FloatArrayCol, CharCol, CharArrayCol
from import root_open
from random import gauss, choice, sample
from string import letters

class Event(TreeModel):
idd = IntCol() # event idd in a run
ipeaks = IntCol() # number of peaks detected on one photo
ip = IntCol() # number of a peak in a given photo
xpos = FloatCol()
ypos = FloatCol()
integral = FloatCol() # peak integral
area = FloatCol() # area of the peak in pixel**2
max_value = FloatCol()
covar_sigx2 = FloatCol()
covar_sigy2 = FloatCol()

def creat_file(name):
print ("— root file is created —")
f = root_open(name,‘create’)
tree = Tree(“tree1”, model=Event)



I have the following error and warning:

WARNING:rootpy.logger.magic:Couldn’t find SetErrorHandler. Please submit a rootpy bug report.
— root file is created —
Traceback (most recent call last):
File “”, line 51, in
File “”, line 33, in creat_file
f = root_open(name,‘create’)
File “C:\Users\sophi\AppData\Roaming\Python\Python27\site-packages\rootpy\io\f”, line 137, in root_open
prev_dir = ROOT.gDirectory.func()
File “C:\Users\sophi\AppData\Roaming\Python\Python27\site-packages\rootpy\ROOT
.py”, line 81, in gSomething
glob = getattr(ROOT, name)
File “C:\bin\root_v5.34.34\bin\”, line 455, in __getattr1
File “C:\Users\sophi\AppData\Roaming\Python\Python27\site-packages\rootpy\defa”, line 157, in wrapFinalSetup
File “C:\Users\sophi\AppData\Roaming\Python\Python27\site-packages\rootpy\defa”, line 91, in configure_defaults
this_dll = C.CDLL(None)
File "C:\Users\sophi\Anaconda2\lib\ctypes_init
.py", line 362, in init
self._handle = _dlopen(self._name, mode)
TypeError: expected string or Unicode object, NoneType found

Actually, I have that worning every time I import something from rootpy for the first time. I also can not open a root file and save it.

Any ideas?

Thank you in advance,

Hi Basia,

This page says:

So it looks like Windows is not supported…

Cheers, Bertrand.