LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Python/LabVIEW 32-bit and 64-bit on the same computer?

I have a couple of projects that need different LabVIEW bitness (32 and 64), and each needs access to python. So I have LabVIEW 32 and 64 installed (2025), and python 32 and 64 installed (3.12.10). How do I tell Open Python Session.vi which version of python to run? I think it is defaulting to whichever version was installed last and is therefore uppermost in the PATH variable, so half the time the incorrect version of python is selected. 

 

Thanks, 

 

David

0 Kudos
Message 1 of 7
(156 Views)

The Python path is an environment variable if memory serves, so you'd need to change that before starting. Do you need Python 64 for LV64?

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 7
(145 Views)

Yamaeta is correct.

You can not set both Python in the environment variable, choose one.

 

Or you can create two links of both python version with for example names "python_x32.exe", "python_x64.exe", and add the folder path of them into environment variable. In labveiw call the python with the name you added in environment variable.

Message 3 of 7
(128 Views)

Or you can create two links of both python version with for example names "python_x32.exe", "python_x64.exe", and add the folder path of them into environment variable. In labveiw call the python with the name you added in environment variable.


That seems like a good idea. I'm not sure what you mean by "link". A shortcut? I'd have to do this from LabVIEW somehow on machines that are running my built application. 

0 Kudos
Message 4 of 7
(114 Views)

I'm not sure how to implement the link idea. Open Python Session.vi and Open Venv Python Session.vi take a version number in their Python Version input, like "312" or "310". LabVIEW then seems to use the python version corresponding to the topmost version in the PATH variable. So it seems like I need to edit the path to make the appropriate python version (32 or 64 bit) topmost before invoking it.

0 Kudos
Message 5 of 7
(90 Views)

According to NI (and it seems to be correct), LabVIEW runs the correct version of python automatically. There's nothing explicit that needs to be done by the user. 

Message 6 of 7
(66 Views)

@FlatCat wrote:

I'm not sure how to implement the link idea.


I don't know the status quo, but in labview 2020 64 bit the python node will use the version installed in 'C:\program files\python'

 

If you avoid the python node and you use python directly via shell from within labview, you can apply the link idea - link in terms of (absolute) paths to an python.exe

 

 

you can create those python.exe by copying manually the content of the folder in 'C:\program files\python'  (which is easier to use)

or better: download the python.exe from the so-called embedded python (this is harder to use, because of pip)

 

 

 

Message 7 of 7
(44 Views)