04-03-2024 07:20 AM - edited 04-03-2024 07:27 AM
Hi everybody,
I am very new to LabVIEW and I am experiencing a very strange problem: Python is not working with my LabVIEW installation, not even the simplest example case. I would really appreciate any help or advice, cause I am messing around with this issue for hours now.
Some information about the system:
I use a 64bit LabVIEW Version 2024 Q1 together with a python 3.9 64bit installation (by Microsoft Appstore). I chose this version, to make sure, that I do not run into a version conflict:
Path variables are setup correctly (installation is under C:\users\peter.schmidt\AppData\Microsoft...). From above you can also see, that I can access python via cmd:
echo %Path%:
From my point of view, the installation should be correct. I first tried the examples coming with LabVIEW, none of these worked. Then I created the most simple example ever:
My VI looks as follows:
It just consists of a Python Session On -> Python Node -> Python Session Off. The python code in MyTestFunc.py is:
So this simple Test() Function does not take any arguments and just resturns a float constant 2.2. Running this test VI gives me Error 1761:
It basically seems that LabVIEW does not find the correct python path. However, if I pipe-in the python path, by connecting the string constant (e.g. C:\Users\peter.schmidt\AppData\Local\Microsoft\WindowsApps\python.exe) with the Open Python Session INPUT for python Path:
I will receive Error 1671:
What am I doing wrong? At first I thought it is because I have zero experience in LabVIEW, but even the LabVIEW-Python Examples do not work. Does any know what to check for as a next step?
Is it possible, that the dot in the user name "peter.schmidt" causes an issue?
Many Thanky!
BR,
Peter
Solved! Go to Solution.
04-03-2024 07:32 AM
there is an error in you python version string, it should be 3.9 and NOT 3.09
04-03-2024 07:55 AM - edited 04-03-2024 07:55 AM
Many thanks for the reply! Shame on me, you are right! Unfortunately, that does not fully resolve the issue. With the correct version string, 3.9, I still run into errors:
If I keep the python Path connected, I will receive Error 1761 now:
If I disconnect, e.g. let LabVIEW choose the python path by system path, then I now receive a new Error 1672:
04-03-2024 09:04 AM
And you have tried to run your py function in python ?
04-03-2024 09:20 AM
Yes, of course:
I mean, it doesn't do something impressive. I added a print line and called the function (without a call actually nothing will happen) just to see some output and it works fine.
04-03-2024 09:46 AM
For me it works in this combination and take a note I have default python in PATH 3.11.6, but 3.9.13 also installed and it works:
and also if I'll disconnect full path to python, still working (kind of magic):
only with wrong version raised error 1761:
But I never ever used installation from Microsoft Store. Try to download and install python "normally" from original website.
04-04-2024 12:46 AM
@Andrey_Dmitriev you are a genius!
After completely removing the MS Store Installation and installing it from the link you shared it works properly!🎉 I thank you so much!
Crap nuggets, I never considered this a possibility - my bad!
It seems that MS Store installation messes up to set PATH Variables correctly.
Thank you so much!
BR,
Peter