pythonenvironment-variables

How to fix this ERROR: Could not load REFPROP (REFPRP64.dll) due to: 126?


I got bellow error during running my python simulation file. After that I got few errors about REFPROP library.

I tried to solve this problem by changing the environment variable. But it is not working. already, All libraries are installed and REFROP is installed in C:\Program Files (x86)\REFPROP.

Good news: It is possible to use REFPROP on your system! However, the library could not be loaded. Please make sure that REFPROP is available on your system.

Neither found in current location nor found in system PATH. If you already obtained a copy of REFPROP from http://www.nist.gov/srd/, add location of REFPROP to the PATH environment variable or your library path.

In case you do not use Windows, have a look at https://github.com/jowr/librefprop.so to find instructions on how to compile your own version of the REFPROP library.

ALTERNATIVE_REFPROP_PATH: ERROR: Could not load REFPROP (REFPRP64.dll) due to: 126. Make sure the library is in your system search path. In case you run 64bit Windows and you have a REFPROP license, try installing the 64bit DLL from NIST.

Can you help me to fix this error in my code?

Screenshot


Solution

  • When we have a problem with any library with python file. So I found the answer for connect REFPROP library to my python file.

    from ctREFPROP.ctREFPROP import REFPROPFunctionLibrary
    
    root = 'C:\Program Files (x86)\REFPROP'
    RP = REFPROPFunctionLibrary(root)
    RP.SETPATHdll(root)