12-29-2021 08:11 PM
Hello, Im new to Lab view and I'm getting a error code that I can't find anywhere. It says:
Error 1761 occurred at Open Python Session in MYvi
Possible reason(s):
LabVIEW: (Hex 0x6E1) The Python DLL of the specified version cannot be loaded at the specified path. Possible reasons include bitness mismatch between Python DLL and LabVIEW that opens the Python session, or a corrupt Python DLL file.
However, I only have one version (3.9.9) of python on windows and its 64 bit and my Labview literally says (64 bit). I doubt i have a corrupt DLL file but i admit I can't locate it or really know what it is.
Solved! Go to Solution.
12-29-2021 09:38 PM
Which LabVIEW version (LabVIEW 2021 or older) are you using??
Currently Python 3.9 is supported in LabVIEW 2021. Check below link.
https://forums.ni.com/t5/LabVIEW/Announcing-LabVIEW-2021/td-p/4172121
If you are using any previous version then it supports 2.7 and 3.6
12-29-2021 09:59 PM
I am currently using Labview 2021 version 21.0
12-29-2021 11:04 PM
Have you set the path and environment variables in your system for python? if not then see the below link
https://www.computerhope.com/issues/ch000549.htm
Also share your python code (py file) so that I can also check with my system
01-11-2022 01:59 PM
Can you clarify which environment variables need to be set? I am getting this same error in Labview 21 with python 3.8.8. I have the python exe in my path and I can run python from the windows cmd line, so Windows at least knows where python is...
01-11-2022 02:46 PM
Nevermind, it looks like I was having more fundamental issues wrt labview python installations since I use anaconda.
For anyone else who ends up here, look at this post:
11-20-2022 07:28 PM
Hi, I've encountered the same problem when calling python using labview. I would like to ask you, how did you solve the problem?
11-27-2022 09:38 PM
NI, why don't you fix this error fundamentally? you are making everyone's life a nightmare with this poor implementation of Python.
01-24-2023 06:41 PM
There is a NI Example available in their example library. What I've found is that, as I've got my python installation (3.9.13) installed and in my environment variables, I was able to plug the location in to the left most VI (left most green string constant of C:\Users\Brian\AppData\Local etc. \python.exe and it worked (the Add function per this NI example).
The instructions to find different python examples are found here (e.g. Help --> Examples etc.). EZ-TechStop gave a PDF above that was similar to what I did for installing Python NOTE the checkmark for add path to environment!
Brian
01-25-2023 04:14 AM
The link posted by kartiknattar only has instructions on how to set environment variables on Windows. But there are no instructions on what variables you need to set in order for the Python node in LabVIEW to start working correctly.
I did some digging into this...
First you need to add the path of your Python interpreter to your PATH environment variable. But this is not enough. The LabVIEW Python node can then "see" the installed version of Python, but cannot connect to it (LabVIEW 2020 error 1671).
You also need to create a PYTHONPATH variable and set the path of the installed Python libraries in it. After that everything works fine.
I haven't tested this trick on a standalone Python installation, but with Python included with OpenOffice and LibreOffice it works. Tested under Win10 x64, LabVIEW 2020 (32-bit) Community and Python versions 2.7, 3.6 and 3.8 (32-bit).
PATH = ....; c:\Program Files (x86)\LibreOffice\program;
PYTHONPATH = c:\Program Files (x86)\LibreOffice\program\python-core-3.8.15\lib; c:\Program Files (x86)\LibreOffice\program\python-core-3.8.15\lib\site-packages;
Site-packages are only needed if you have installed additional packages for python. You can set variables in the system or user section. The system section requires administrator rights.
You can find the script that sets the windows python environment variables in this example: Cross-platform wrapper library for creating OpenOffice and LibreOffice spreadsheet documents via the....