Jump to content
  • 0

Local variable 'result' referenced before assignment


RD3NG

Question

A previous employee created Psychrometric modules in Python using CoolProp. Recently my PC underwent microsoft updates, and ever since then the module creates this error when I try to run a certain worksheet. I created a new test worksheet, using this module and it worked as expected, but the worksheet I need for testing will show the error.

I don't understand how to assign a value to the 'result' variable. I did not make the module and can't find the referenced Psych.py, so I'm wondering if there is a way to fix this through Dasylab, or if troubleshooting is needed through the back end python file. 

I have tried to uninstall and then re-install the CoolProp files in a 'site-packages' folder, and (2) additional .dlp self extracting files without any impact to the error.

Once these 'CoolProp' files were copied into the 'site-packages' folder and .dlp files extracted, they are Enabled in configurator. I wanted not just to disable them, but uninstall them, but I'm not sure how to delete/uninstall them. Not sure if that is the right avenue to go down either.

image.png

image.png

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0

Hello @RD3NG.

Please reference the suggestion posted in another recent post, regarding Psychrometric modules. 

 

5 hours ago, RD3NG said:

Recently my PC underwent microsoft updates

Which version of Windows OS is on the target system now versus the OS version before the Microsoft updates?  Run the winver command from Windows Command Prompt, as shown below.

image.png

 

Which version of Python do you have installed on your Windows system?  Run the python --version command from Windows Command Prompt.

Your screen capture references DASYLab v14.0.1.  Which version of DASYLab did your previous employee use and which version are you using now?

 

Regards,

Fausto

Link to comment
Share on other sites

  • 0

This is the current windows OS. It updated from Windows 10 Version 21H2. The python version is also shown attached as well as the DASYLab version that is currently being used. I believe that the previous employee used the same version.

 

Looking into the module made as well as the suggestion posted above, I think that I am using the same python, and do not need to upgrade python versions.

image.png

image.png

image.png

Link to comment
Share on other sites

  • 0

So you are using DASYLab 2016 v14.0.1 and Python v2.7.10, not DASYLab 2022, is that correct?

Did your previous employee use a Windows 10 OS?

Can you share the employee's known good, original DASYLab worksheet?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...