LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Labview 2018 Python Node and Anaconda Environment

Hey payto, 

I've found this discussion: https://forums.ni.com/t5/LabVIEW/Python-Node-in-LV2018/td-p/3797256/page/2

 

They too are using Anaconda and...

 

After a long time of research, I found the solution :
1. in the command prompt write "cd C:\Users\user\AppData\Python36-32\Scripts" so all the other command will occur in this folder.
2. type "pip install numpy" and the other libraries that you want. I installed matplotlib, scipy, scikit-learn, pillow, pandas, tensorflow (compatible just with Python 64bits) and keras.

 

I'd check out the thread... they're some other advice on how to use this, supported data types etc.

 

Cheers, Rebecca

 

0 Kudos
Message 11 of 19
(4,766 Views)

Hello, 

I don' t understand how to run python on labview. I use anaconda and if I understand it I must install the "normal " python 3.6 ? Is there a way with a detailed explanation of how to proceed ? 

 

Nicolas

 

0 Kudos
Message 12 of 19
(4,644 Views)

personally I gave up the Anaconda idea and I simply used the standard python 3.6

0 Kudos
Message 13 of 19
(4,636 Views)

Yes but how install packages in python 3.6 ? It's easy in jupyter consol but it seem to be more difficult when you have python 3.6 and jupyter. Have you an idea how can I change the path for installing my packages in the python 3.6 ? I had already use the "cd C:\Users\user\AppData\Python36-32\Scripts" to change instalation folder but when I use pip install numpy this command dont runs because pip is don't recognise.

 

Sorry for my english ! 

 

Nicolas

0 Kudos
Message 14 of 19
(4,597 Views)

Hi Cassanati,

 

You seem to suggest you got the python node with python 3.6 working with Labview 2018 32bits? Is that right?

Was that simply by not using a conda environment and installing packages manually? Were there any other "tricks" or system changes you did?

Thanks a lot

 

0 Kudos
Message 15 of 19
(4,569 Views)

No other tricks. Just use the installer from python.org and remember to install the python 32 bit if you use labview 32 bit or the python 64 bit if you use the labview 64bit.

0 Kudos
Message 16 of 19
(4,558 Views)

There are many opportunities for failure in getting LabVIEW to talk to Python and very few paths to success.  Keep in mind that common installations such as Visual Studio Python will not provide a path to success using the default installation.  Pick the wrong installer off of Python.org = fail.  Choose the default installer options off of Python.org's 32-bit Python 3.6.x installer = fail.  I have included one path to success in the attached PDF.  I hope it is helpful. If you have a different path to success please share.  

Message 17 of 19
(3,816 Views)

Thanks for the detailed notes.  Before using your .pdf, I tried for the better part of today to get LabVIEW 2019 64 bit and LabVIEW 2018 32-bit to work with my 64-bit or 32-bit Anaconda python distribution.  I couldn't get past this error in either case:


Error 1671 occurred at Open Python Session in python test.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

Environment variable path was set up to include my python folder.  I even tried having LabVIEW use a call library node to python3.dll.  It would properly find the .dll (using environment path) and could run a few functions (like Py_GetVersion).  Running Py_Initialize on the .dll would cause LabVIEW to crash without even a dialog--maybe that's a clue.  Unfortunately, I never could get the Open Python Session node to succeed with the python located in my anaconda distribution.

 

But once I followed EZ-TechStop's .pdf instructions, it worked!  I suspect that the detailed instructions are more than you need. Based on other posts in this thread, I expect the following is enough:

   1) use the python windows distribution (not anaconda)

   2) ensure the path environment variable is set up properly, either via the installer as EZ-TechStop indicated in the .pdf, or as indicated in the NI instructions here.

 

Losing the ability to call into a specific conda environment is a bummer.  The code I'm using is shared among my coworkers using conda.  I guess I'll need to set up and maintain entirely new Python distribution just for LabVIEW to call into.  Fingers crossed this will work.  Even if it does, keeping two distributions of my code healthy will be extra work.  If anyone was successful at getting LabVIEW to work with an anaconda distribution, please share.

 

So far I'm able to use python 3.7 with LabVIEW 2018 32-bit just fine.  I'm just getting started, however.

Message 18 of 19
(3,342 Views)

I have a deep neural network code in jupyter notebook with a virtual anaconda environment using keras with tensorflow. The program takes a large 1D array(say 10^6 samples) as input and outputs a modified data of the same size. Now, I have to pass the data from a labview project that i have done, to this program and the output from this program is again fed into labview which will be transmitted via usrp. How can i interface the jupyter code and labview? Is it possible? Please do respond.

0 Kudos
Message 19 of 19
(2,873 Views)