06-20-2023 03:34 PM
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?
06-21-2023 05:50 AM
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.
12-05-2023 06:48 PM
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=PLS
12-06-2023 02:38 PM
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 ?
12-06-2023 03:06 PM
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.
12-06-2023 04:20 PM
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 ?
12-06-2023 06:13 PM - edited 12-06-2023 06:22 PM
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?
12-07-2023 08:43 AM
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.
12-08-2023 05:19 PM
Thank you so much for your effort. I tried your suggests but it did not work. Is there anyone to solve this problem?
Thanks.
12-09-2023 05:35 PM
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 )
This is for LabVIEW 2023 Q3 and python 3.11.6