LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error 1761 occurred at Open Python Session in MYvi.vi

Solved!
Go to solution

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.problem block diagram.JPG

 

0 Kudos
Message 1 of 11
(9,860 Views)

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

 

https://www.ni.com/en-in/support/documentation/supplemental/18/installing-python-for-calling-python-...

 


CLD Using LabVIEW since 2013
0 Kudos
Message 2 of 11
(9,826 Views)

I am currently using Labview 2021 version 21.0

0 Kudos
Message 3 of 11
(9,822 Views)
Solution
Accepted by topic author tomhugo71

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


CLD Using LabVIEW since 2013
0 Kudos
Message 4 of 11
(9,802 Views)

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... 

Message 5 of 11
(9,680 Views)

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:

https://forums.ni.com/t5/LabVIEW/Labview-2018-Python-Node-and-Anaconda-Environment/td-p/3853701/page...

 

Message 6 of 11
(9,671 Views)

Hi, I've encountered the same problem when calling python using labview. I would like to ask you, how did you solve the problem?

0 Kudos
Message 7 of 11
(7,921 Views)

NI, why don't you fix this error fundamentally? you are making everyone's life a nightmare with this poor implementation of Python.

Message 8 of 11
(7,823 Views)

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).

ZeroNegative_0-1674606744307.png

 

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

 

0 Kudos
Message 9 of 11
(7,301 Views)

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....

0 Kudos
Message 10 of 11
(7,272 Views)