From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview 2018 Python Node and Anaconda Environment

Hello, I am trying to use an environment that I created with Anaconda (Python 3.6) inside labview, but for some reasons it doesn't seem to work as I expect.

I add the folder of my conda environment in my windows environmental path, as shown in the screenshot.

When I open the python session with labview I specify 3.6 but as soon as I start my code I get Error 1663

 

LabVIEW: (Hex 0x67F) Unable to load the Python interpreter of the specified version. Ensure that you install the supported versions of Python, and the bitness of Python matches the bitness of LabVIEW that opens the Python session.

 

In my computer there is Python 2.7 installed as default (and when I open a python session with version 2.7 on labview it works flawlessly) and I don't have the admin rights in order to set the environmental path for all users. I thought i could just set the python path of the current user (me) and then it would automatically find it but it doesn't seem to work. What do I do wrong?

Thank you in advance!

0 Kudos
Message 1 of 20
(13,286 Views)

I just tried out anoter thing

I tried to call Python version 2.7 (which is by default installed in my computer, in the folder C:\Python27 ) and then i called a small function that I wrote that lists the installed packages and the current python path.

Turns out that the called python version is not the one installed on C:\Python27, but the one installed here:

C:\Program Files (x86)\National Instruments\Shared\NIPythonInterface

 

Now I'm really confused, I don't understan which criteria is used by LabView to choose the Python version (and I still need to call my own Python 3.6 environment, which I didn't manage to do yet).

Any help would be really appreciated!

Message 2 of 20
(13,249 Views)

Hi,

 

As per the error code - are you sure you use same bit versions of LV and python (32 vs 64 bit)?

You may find this post useful: https://forums.ni.com/t5/LabVIEW/Python-Node-in-LV2018/m-p/3843330#M1087769

Best Regards,
TK
Certified LabVIEW Architect (CLA)

0 Kudos
Message 3 of 20
(13,231 Views)

good point, i was using labview 32bit and by default anaconda was creating always 64bit environments.

so I used the command

set CONDA_FORCE_32BIT=1

and then i created my environment, it actually is a 32 bit as I can read here:

Python 3.6.7 |Anaconda, Inc.| (default, Oct 24 2018, 09:37:04) [MSC v.1912 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.

but now i get a different error (1671) when I call from labview:

 

Error 1671 occurred at Open Python Session in python.vi

Possible reason(s):

LabVIEW: (Hex 0x687) There was an error in executing the specified function.


Python returned the following error: Error creating host process

 

what am I doing wrong this time?

0 Kudos
Message 4 of 20
(13,212 Views)

I still have the same problem and can't move forward. Is there at least a way to install/update some packages on top of this Phython 2.7 that is installed together with labview?

0 Kudos
Message 5 of 20
(13,176 Views)

I have the exact same issue running python 3.6.0 32 bits installed through conda on windows with LV2018 32bits.

 

Error 1671 occurred at test_python.vi

Possible reason(s):

LabVIEW: (Hex 0x687) There was an error in executing the specified function.


Python returned the following error: Error creating host process

 visnippet.png

This is the code that throws this error.

 

The same computer can run LV2018 64bits and Python 3.7 64bits and these will talk to each other.

Anyone has any ideas? Could this be that the 32 bits version of Labview does not support python 3.6?

 Thanks

0 Kudos
Message 6 of 20
(13,155 Views)

Hey Payto, 

 

Where is the code stored? usually error 1671 is due to the code being saved on a network drive.

Error 1671 Using Python Script Stored on Network Drive in LabVIEW

 

Let me know how it goes, 

Rebecca

0 Kudos
Message 7 of 20
(13,133 Views)

Hi Rebecca, 

 

The code is stored on the C:\ drive, the same as labview and the OS.

 

Thanks,

0 Kudos
Message 8 of 20
(13,130 Views)

Hey payto, 


The only other record I can find of this error is due to LabVIEW inputs/outputs and data types not matching the actual number of inputs and type to the python function. I'd double check this too.

 

I couldn't find confirmation that Anaconda Python was compatible with Python node in LabVIEW, so it  might be worth trying traditional Python instead?

 

Kind regards, 

Rebecca

0 Kudos
Message 9 of 20
(13,119 Views)

Hi Rebecca, 


This is an issue with the "Open Python Session" not the "Python node" I therefore do not have access to the inputs (I really wish I did!).

 

Anaconda is simply a distribution of python with conda managing packages and your environment. It is still just "python" but installation and managing of modules and dependencies doesn't have to be done manually. It doesn't seem like it should make a difference as externally it is the same version of python but with the configuration managed by another program. As I detail in the other thread in which you also replied, I've tried a lot of things with conda based environments which all work on the 64bit version of Labview:

https://forums.ni.com/t5/LabVIEW/Python-session-fails-to-open-Windows-7-64bits-LV2018-32bts/m-p/3857...

 

Thanks,

0 Kudos
Message 10 of 20
(13,115 Views)