1.
When I import the ctREFPROP package in python, I get an error when I run the following code:
import os, sys
import ctREFPROP.ctREFPROP as ct
r = ct.REFPROPFunctionLibrary(os.environ['RPPREFIX'],'dll')
r.SETPATHdll(os.environ['RPPREFIX'])
z = [1]
T = 200 # K
p = 101.325 # kPa
r.SETUPdll(1, 'NITROGEN.FLD', 'HMX.BNC', 'DEF')
r.SETREFdll("DEF",1,z,0,0,0,0)
D, Dl, Dv, x, y, q, e, h, s, Cv, Cp, w, ierr, herr = r.TPFLSHdll(T,p,z)
eta, tcx, ierr, herr = r.TRNPRPdll(T,D,x)
wm = r.WMOLdll(z)
Error message:KeyError:‘RPPREFIX’
The process shows that there is a problem in this piece of code:
r = ct.REFPROPFunctionLibrary(os.environ['RPPREFIX'],'dll')
2.
Someone told me it might be an issue with the environment variable setting,So I changed the above piece of code to:
r = ct.REFPROPFunctionLibrary('C:\Program Files (x86)\REFPROP\REFPRP64.DLL', 'dll')
But I don't have this file:'C:\Program Files (x86)\REFPROP\REFPRP64.DLL'
3.
So I went looking for where this dll file might exist. It seems that this file is in the refprop package, but I imported the dll file path in Python and found that it didn't work.
Versions
REFPROP Version: 10.2
Operating System and Version: Win11
Access Method: Python
Description
1. When I import the ctREFPROP package in python, I get an error when I run the following code:
import os, sys import ctREFPROP.ctREFPROP as ct r = ct.REFPROPFunctionLibrary(os.environ['RPPREFIX'],'dll')
r.SETPATHdll(os.environ['RPPREFIX']) z = [1] T = 200 # K p = 101.325 # kPa r.SETUPdll(1, 'NITROGEN.FLD', 'HMX.BNC', 'DEF') r.SETREFdll("DEF",1,z,0,0,0,0) D, Dl, Dv, x, y, q, e, h, s, Cv, Cp, w, ierr, herr = r.TPFLSHdll(T,p,z) eta, tcx, ierr, herr = r.TRNPRPdll(T,D,x) wm = r.WMOLdll(z) Error message:KeyError:‘RPPREFIX’
The process shows that there is a problem in this piece of code:
r = ct.REFPROPFunctionLibrary(os.environ['RPPREFIX'],'dll')
2. Someone told me it might be an issue with the environment variable setting,So I changed the above piece of code to: r = ct.REFPROPFunctionLibrary('C:\Program Files (x86)\REFPROP\REFPRP64.DLL', 'dll') But I don't have this file:'C:\Program Files (x86)\REFPROP\REFPRP64.DLL'
3. So I went looking for where this dll file might exist. It seems that this file is in the refprop package, but I imported the dll file path in Python and found that it didn't work.
Versions
REFPROP Version: 10.2 Operating System and Version: Win11 Access Method: Python