BenThelen / python-refprop

Python (3.x & 2.x) API for NIST Standard Reference Database 23 (a.k.a. Refprop) on Linux and Windows
Other
43 stars 25 forks source link

[bug] while calling setpath _rp was never defined #4

Closed ghost closed 10 years ago

ghost commented 11 years ago

Hi, i am trying to use your api but get errors calling setpath routine. The problem is _rp does not get defined and throws the error while it is called in _setpath. _rp only is set in _load which only gets called in setup.

Can you help me fix this problem?

Traceback:

In [1]: import refprop as rp

In [2]: rp.setpath('u:/develop/python_modules/refprop/')

AttributeError Traceback (most recent call last)

in () ----> 1 rp.setpath(u'u:/develop/python_modules/refprop/') U:\develop\python_modules\refprop\refprop.pyc in setpath(path) 575 _fpath = path 576 #set path for refprop --> 577 _setpath(path) 578 579 U:\develop\python_modules\refprop\refprop.pyc in _setpath(hpth) 615 _rp.setpath_(ctypes.byref(_hpth), ctypes.c_long(255)) 616 elif platform.system() == u'Windows': --> 617 _rp.SETPATHdll(ctypes.byref(_hpth), ctypes.c_long(255)) 618 619 AttributeError: 'NoneType' object has no attribute 'SETPATHdll' In [3]: print rp._rp None In [4]: ls "u:/develop/python_modules/refprop/" 05.07.2013 10:23 . 05.07.2013 09:26 .. 25.03.2013 16:44 fluids 19.03.2013 17:40 mixtures 04.07.2012 13:13 1.336.020 refprop.dll 05.07.2013 10:19 311.929 refprop.py 05.07.2013 10:23 207.461 refprop.pyc
jlee2109 commented 10 years ago

I'm having the same issue and would very much like to resolve it. We're trying to use refprop and your wrapper for some really cool purposes and need to get this working! If you can suggest how to fix this issue, I would greatly appreciate it.

BenThelen commented 10 years ago

I've updated the refprop - python API, it's working for me on Linux and Windows for python version 3.x, can you try for python2.7 and give me feedback. thanks