07-19-2018 06:06 AM - edited 07-19-2018 06:08 AM
Hi luboss333,
I get the same error. I've been reading a little bit about Python matplotlib backends, but I do not have the solution yet. Would you be willing to begin a new discussion forum post to get more visibility on that error? Perhaps someone else has already solved it!
I'm glad that numpy, scipy, and matplotlib are working for you otherwise. I'll be sure to follow the new post.
Best regards!
Chad
07-22-2018 02:13 PM - edited 07-22-2018 02:14 PM
Hello luboss333 and chericks,
although I don't know a solution to solve Qt platform plugin error in windows, there is one simple way how to avoid it and display your graph in new window by labview. You must switch backend in matplotlib in your python function, for example to "TKAgg". Refer to https://matplotlib.org/faq/usage_faq.html#what-is-a-backend for more info about backends. I have attached example .py and VI which are modified versions of chericks.
Regards
Lukas
07-22-2018 03:54 PM
Hi Lukas,
Thanks for your reply. I ran your example. "TKAgg" worked for me as well.
Well done!
Chad
07-24-2018 02:54 PM
Thank you Lukas
it works great 🙂
07-27-2018 11:38 AM
Hi chericks,
I am using Python 2.7 and get the same error.
I have Anaconda directory in User variables and System variables:
C:\Users\San\Anaconda
However, the VI still doesn't work. You have any idea why.
Thanks,
San
07-30-2018 11:58 AM
Hi San,
Sorry for the delay. You mentioned the VI doesn't work. What error message do you see?
Questions:
- Do you have multiple versions of Python installed?
- Which IDE do you use for Python development?
Perhaps I can create a new image, install LabVIEW and your Python version / IDE, to reproduce and overcome the issue.
Best regards,
Chad
07-30-2018 05:33 PM
Hi Chad,
Thanks so much for your reply!
My error message is the same as the error above: "No module named numpy".
I only have one version of python which is 2.7.
My IDE is Anaconda 2.3.0.
My PC is 32 bit.
Best regards,
San
08-29-2018 06:17 AM - edited 08-29-2018 06:42 AM
Thank you for your example. I just tried it.
Just to make it clear you can call the funktion with parameters. And it is possible to have a complex return value, for example in json.
I would like to hear about use cases of other users.
09-09-2018 04:28 AM
what if I want to send a numpy array to labview
assume I have an array called ko
if I use :
ko.append(30)
it will successfully send 30 to labview
but
numpy.append(ko,30)
won't do it.
any ideas?
09-25-2018 09:25 AM
Hi everyone,
I had the same issue with python node trying to import numpy library, everytime I ran a code with numpy LabVIEW responded with the 'ModuleNotFoundError' error No module named 'numpy'.
My computer is configured with Anaconda3. To resolve this problem, I install python3.6 in addition of the python installed in Anaconda but be careful on the bitness of your LabVIEW. If you are using labVIEW 32bits, install python 3.6-32bits. And if you install LabVIEW 64bits, Python 3.6-64bits evenwhile LabVIEW will not succeed to find the interpreter of Python.
Also take care of the library that you are using, for my part, I was using numpy but also Keras with tensorflow for Deep Learning example. The problem is that tensorflow is just compatible with Python 64bits.
So what I have done is that I installed python 3.6.6 for 64bits without adding Python 3.6 to the environment variable.
The first time I run the code of chericks, LabVIEW responded with the 'ModuleNotFoundError' error No module named 'numpy' even if I had python 3.6 installed. So when I went to the installation folder "C:\Users\user\AppData\Local\Programs\Python\Python36" I saw that the numpy library was not here.
I decided to install the library in it.
But another problem appears when I use the command "python -m pip install numpy" in command prompt, a message appeared "Requirement already satisfied: numpy in c:\users\user\anaconda3\lib\site-packages (1.14.5)".
I couldn't install numpy because numpy was already installed in anaconda (the solution of putting the Path of Anaconda in User variable and Environment variable didn't work for me).
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.
After these steps you will be able to run the codes which use your libraries.