CalebBell / thermo

Thermodynamics and Phase Equilibrium component of Chemical Engineering Design Library (ChEDL)
MIT License
594 stars 114 forks source link

pyinstaller error: CEOSLiquid is not defined #114

Closed dkchung22 closed 2 years ago

dkchung22 commented 2 years ago

While making execution file using pyinstaller, some error occured which were not in pycharm as in attached picture file. Would like to know solution method. Thanks. CEOSLiquid_error

CalebBell commented 2 years ago

Hi dkchung22, I think I know what that issue is, and I have fixed it in Thermo 0.2.21. Why don't you give it a go with that version? Sincerely, Caleb

dkchung22 commented 2 years ago

Thank you Caleb for quick reply. It works fine by new version.

CalebBell commented 2 years ago

I'm happy to hear that! I did a bit of testing and it looks like right now, the extra files that need to be added to pyinstaller's .spec file are as follows:

added_files = [
         ( '$CHEMICALS_FOLDER/chemicals/Critical Properties', 'chemicals/Critical Properties' ),
         ( '$CHEMICALS_FOLDER/chemicals/Density', 'chemicals/Density' ),
         ( '$CHEMICALS_FOLDER/chemicals/Electrolytes', 'chemicals/Electrolytes' ),
         ( '$CHEMICALS_FOLDER/chemicals/Environment', 'chemicals/Environment' ),
         ( '$CHEMICALS_FOLDER/chemicals/Heat Capacity', 'chemicals/Heat Capacity' ),
         ( '$CHEMICALS_FOLDER/chemicals/Identifiers', 'chemicals/Identifiers' ),
         ( '$CHEMICALS_FOLDER/chemicals/Interface', 'chemicals/Interface' ),
         ( '$CHEMICALS_FOLDER/chemicals/Law', 'chemicals/Law' ),
         ( '$CHEMICALS_FOLDER/chemicals/Misc', 'chemicals/Misc' ),
         ( '$CHEMICALS_FOLDER/chemicals/Phase Change', 'chemicals/Phase Change' ),
         ( '$CHEMICALS_FOLDER/chemicals/Reactions', 'chemicals/Reactions' ),
         ( '$CHEMICALS_FOLDER/chemicals/Safety', 'chemicals/Safety' ),
         ( '$CHEMICALS_FOLDER/chemicals/Thermal Conductivity', 'chemicals/Thermal Conductivity' ),
         ( '$CHEMICALS_FOLDER/chemicals/Triple Properties', 'chemicals/Triple Properties' ),
         ( '$CHEMICALS_FOLDER/chemicals/Vapor Pressure', 'chemicals/Vapor Pressure' ),
         ( '$CHEMICALS_FOLDER/chemicals/Viscosity', 'chemicals/Viscosity' ),
         ]

Where $CHEMICALS_FOLDER is replaced on your computer with the folder you have the chemicals repo in. The argument

    datas=added_files,

should be provided for the Analysis section.

It seems in hindsight it would have been better if all of the data folders had been inside another folder.