03-29-2023 06:24 AM
I'm using the LabVIEW 2023 Q1, and trying to use virtual environments (the latest feature). But it failed.
My question is, "what should I set as the Env path of the VI for Venv Python"? Details are as follows.
Sorry, I am not allowed to upload files... I'll make things clear:
Step 1: Run "python -m venv venv" to create a virtual environment on my Desktop for my Python 3.7.
Step 2: Open LabVIEW, select "Open Virtual Environment Session.vi" and then switch to "Open Venv Python Session"
(The VI is exactly the same as the third image in https://forums.ni.com/t5/LabVIEW/Announcing-LabVIEW-2023-Q1/td-p/4283847 )
(This VI requires to set Env path and Python version)
Step 3: I selected C:\Users\roy\Desktop\venv\Scripts\python.exe as Env path, and typed 3.7 as Python version
Step 4: Run
Step 5: I got the following error:
Error 1746 occured at Open Venv Python Session.vi
Possible reason(s):
LabVIEW: (Hex 0x6D2) The path to the Venv virtual environment was not found.
(No results in the provided link: https://www.ni.com/en/search.html?q=%22error%201746%22)
I thought the Env path should be a folder, not a file path. However, I was asked to select a file path.
I have no idea which file should I select. I'd tried to select some other files under the venv folder, but got failed as well.
Thanks for your time.
Solved! Go to Solution.
03-30-2023 03:08 AM - edited 03-30-2023 03:34 AM
Hi RoyHo,
you did most of the things correct. You only need to change the path for your virtual environment to --> C:\Users\roy\Desktop\venv
You should refer to the root directory of your venv then it should work. (at the moment paths with spaces are not working. we already submitted this to NI)
We created a post how to set it up on our website.
Python venv Support in LabVIEW 2023 Q1
https://kreiseder.org/2023/03/python-venv-support-in-labview-2023-q1
Best Regards,
Andreas
03-30-2023 10:36 PM
Hello Andreas,
Thank you very much. It works. The post on your website is also very helpful.
I'm a newbie to LabVIEW. Below just for a record, hope it helps some others.
For the path of your virtual environment, when you click "Browse for Path...", a dialog box will pop up asking you to select a file.
There is a button, "Current Folder," in the dialog box. You may push the button to select a folder. And here you have to select a folder.
Thanks again.
05-22-2023 09:43 AM
have you received an answer/update from NI as to when it will support spaces in the path?