LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Python 3.11 error 1672 trying to open and close session on LabVIEW 2023

cyrus123_0-1687293052055.png

cyrus123_1-1687293165332.png

 

I am inputting 3.11 for "Python version" and the path to the file.  I cannot simply open and close a session, get error 1672.  Does anybody know a fix?

0 Kudos
Message 1 of 11
(2,593 Views)

The Python Path is NOT to your python file but to the Python exe file. 
It is all there in the documentation of the Open Python Session. 

0 Kudos
Message 2 of 11
(2,545 Views)

Hi, I am trying to deal with the same error. Your answer is not correct. Could you please take a look at the screen shot? I am also dropping a link about this SS. The path is the Python file, not an executable file. This YouTuber can run LabVIEW without any errors. However, I am getting error code 1672. Could you please help me? Thank you so much.

 

 

Link: https://www.youtube.com/watch?v=42N30hybv-o&ab_channel=PLSerror 1672.png

0 Kudos
Message 3 of 11
(2,136 Views)

Then what version of Python do you use ? 

What is the bitness, 32 or 64 bit version of python ?

 

What version of LabVIEW ? 

What bitness of LabVIEW, 32 or 64 bit ?

0 Kudos
Message 4 of 11
(2,109 Views)

Hello Sir, 

 

Thank you for your quick response. I am trying to do this with 2 different LabVIEW and Python versions.

 

1) LabVIEW 2023 Q3 (64-bit) and Python 3.6.0 (64-bit)

2) LabVIEW 2018 (32-bit) and Python 2.7.11 (32-bit)

 

If i run "python -V" in terminal, it says "python 3.6.0" . Also, Open Python Session Function Help says that "Python version specifies the version of Python in which the Python session runs. This function supports Python of versions 3.6 through 3.9 only."

I am getting this error that attached. It would be amazing if you solve my proble. Thank you.python code.pnglabview vi.png

 

 

0 Kudos
Message 5 of 11
(2,102 Views)

That is a different problem. 

 

That error indicates that there is an error with what value your python code is returning. 

 

Can you type cast the value to an integer in python before you are returning it ? 

0 Kudos
Message 6 of 11
(2,082 Views)

Hello again,

 

I changed the code, I added int() function before returning but I am getting the same error.

Then,

I changed the code, I added str() function before returning but result is the same 😞 Is there any possible way to handle it?

python code 3.pnglabview vi 3.png

 

python code 2.pnglabview vi 2.png

0 Kudos
Message 7 of 11
(2,075 Views)

To be honest, I don't know enough about python to know what that error is.
You could try to make ( ) around the return variable, like "return (stringValue)"

 

Or try to give your function another name, could be that getClassData is a system function.

0 Kudos
Message 8 of 11
(2,055 Views)

   Thank you so much for your effort. I tried your suggests but it did not work. Is there anyone to solve this problem? 

Thanks.

0 Kudos
Message 9 of 11
(2,028 Views)

So this worked for me: 

class myClass(object):
    def __init__(self, parameter):
        self.MyData = parameter
    def GetValue(self):
        return self.MyData


def getMyClassData():
    newMyClassobject = myClass(4882)
    value = newMyClassobject.GetValue()
    return( value )
   

 

dkfire_0-1702164808020.png

 

This is for LabVIEW 2023 Q3 and python 3.11.6

 

Download All
0 Kudos
Message 10 of 11
(1,996 Views)