我试图通过python访问NIST refprop数据库。为此,我从http://www.boulder.nist.gov/div838/theory/refprop/Frequently_asked_questions.htm下载了refprop python模块
尝试导入模块时,收到以下错误:

>>> import REFPROP
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python33\lib\REFPROP.py", line 6525, in <module>
   setpath()
File "C:\Python33\lib\REFPROP.py", line 381, in setpath
   _setpath(path)
File "C:\Python33\lib\REFPROP.py", line 421, in _setpath
   _rp.SETPATHdll(ctypes.byref(_hpth), ctypes.c_long(255))
File "C:\Python33\lib\ctypes\__init__.py", line 366, in __getattr__
   func = self.__getitem__(name)
File "C:\Python33\lib\ctypes\__init__.py", line 371, in __getitem__
   func = self._FuncPtr((name_or_ordinal, self))
AttributeError: function 'SETPATHdll' not found
>>>

我发现这个SETPATHdll函数不包含在refprop.dll文件中。不过,模块是为这个文件编写的。有人能帮忙吗?
谢谢您。

最佳答案

将CoolProp与REFPROP包装一起使用:
安装:
https://pypi.python.org/pypi/CoolProp/4.2.5
示例:
http://coolprop.sourceforge.net/FluidInformation.html#refprop-fluids-and-mixtures

关于python - 使用python访问refprop:SETPATHdll错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/13267808/

10-11 22:42