LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview and python without installing python

Hello, I am using labview 2018 with the "new" python support. On my computer it works flawlessly (both LV and Python are 32bit), but now I have to run the same code on other computers where only the labview runtime is installed.

Because I don't have admin rights on this computer, I thought I could simply copy the python folder from my computer to the target computer and then add the path of the python folder to the system environment (as "normal user" I can add an environment path for the current user but not for all the users).

Unfortunately this doesn't work: I created a simple executable that opens a python session and runs a dummy python function, but as soon as I open the python session the python dll (python36.dll) is not found.

But if I INSTALL a very very basic python downloaded from here https://www.python.org/downloads/release/python-367/ then it suddenly works.

So what I tried was the following: make a copy of the python folder before uninstalling it, then uninstall and then place the python copy back where it was and then set the environment path exactly as it was before uninstalling. And it does not work.

So my question is: what is the difference between copying the python folder + setting the environment path and installing python?

Is there a way to simply copy the python path without installing it? We have so many computers and users, I can't install python everywhere and for every single user, but I could automatize the folder copy and system environment creation (if it would work...).

What am I doing wrong? Is there anybody who can help me?

Thank you in advance

0 Kudos
Message 1 of 7
(3,165 Views)

I assume this is the same problem, maybe with the same solution.

 

Note that the DLL needs to be copied to a path where your executable can find it. For instance, in the executable's directory, or a subdirectory. You might need to set execution rights on the dll.

0 Kudos
Message 2 of 7
(3,138 Views)

The whole folder is generated for one user only (as I have no admin rights on the computers so i can install python only like this) and i just checked, the dll has excecution rights...

0 Kudos
Message 3 of 7
(3,135 Views)

Have you put the dll into your Project in a virtual folder?  Then make sure that folder is included into your built application.

http://zone.ni.com/reference/en-XX/help/371361R-01/lvdialog/source_files_tab/

0 Kudos
Message 4 of 7
(3,116 Views)

Hello. I tried that too but it didn't help. But i found out something interesting: when I install the Python downloaded from python.org it works, but when I install the same python version from MiniConda it does not work (even though the same environment variables are written and it is installed on the same subfolder of C:\). I even tried to exchange the "official" python folder with the MiniConda folder but it did not work. So my conclusion is that the "official" python writes something in the windows registry that labview can find, while Miniconda doesn't.

I am going to dig deeper, but I am still a bit disappointed that the "open python session" from labview is so poor of parameters and debug options..

0 Kudos
Message 5 of 7
(3,094 Views)

Hello,

 

This is because LabVIEW is not capable of using python versions installed using virtual environments (such as miniconda, venv, etc.). This is due to the way this virtual enviroments wrap python.

It doesn't have to be the version installed from the web, because I've tried installing python with pyenv and it works. There are three things you have to take into account:

1- the bitness of the python version (needs to match LabVIEW bitness)

2- the version of the python you're using has to be compatible with your LabVIEW version

3- set the path of your python installation to open the python session.

 

(in this case using pyenv as python version administrator the path is: C:\Users\your_username\.pyenv\pyenv-win\versions\3.9.0-win32\python.exe)

 

Regards,

Iñigo.

 

0 Kudos
Message 6 of 7
(1,094 Views)

@IPach wrote:

This is because LabVIEW is not capable of using python versions installed using virtual environments (such as miniconda, venv, etc.). 


LabVIEW 23 is.

 

See what's new in LabVIEW:

What is LabVIEW? Graphical Programming for Test & Measurement - NI

 

This page will probably change over time... See

LabVIEW 2023 Q1 Features and Changes - NI 

for LV23 specific changes.

0 Kudos
Message 7 of 7
(1,087 Views)