LabVIEW 2021 Public Beta

cancel
Showing results for 
Search instead for 
Did you mean: 

[New Feature] Improved Python Support

LabVIEW 2021 adds support for Python 3.7, 3.8, and 3.9. It maintains support for Python 3.6 but deprecates support for Python 2.7.

 

The Open Python Session function now takes an optional parameter for the path to the Python executable:

Christina_R_0-1618886008391.png

 


Christina Rogers
Product Owner, LabVIEW R&D
Message 1 of 18
(1,899 Views)

Have there been any other improvements to the Python interface from LabVIEW, or it is confined to adding support for these new versions?

 

I had an SR early this year looking for help to get more precise feedback than a particularly cryptic run-time exception was able to provide. Through the SR, I provided some feedback on how I worked through the issue in the end, and was told it would be passed on to Product Planning.

 

Given the increasing number of opportunities we have which incorporate Python in some way, I'm interested to see this interface mature. For example, this post on the Idea Exchange (https://forums.ni.com/t5/LabVIEW-Idea-Exchange/Console-for-Python-Node/idi-p/4008486?profile.languag...) would have been a boon during my troubleshooting.

0 Kudos
Message 2 of 18
(1,641 Views)

I can confirm that Product Planning and R&D received your feedback. We haven't yet added features in response, but we're considering improvements for future releases.

 

I'd like to get your feedback on an unpublished feature that's in LabVIEW 2018 and later. If you edit your INI file to contain "ShowConsoleForPythonNode=TRUE" then a window will open when a Python Node executes to show the output from Python. Do you think this functionality is useful enough that it should be presented in the LabVIEW editor?


Christina Rogers
Product Owner, LabVIEW R&D
Message 3 of 18
(1,565 Views)

@Christina_R wrote:

Do you think this functionality is useful enough that it should be presented in the LabVIEW editor?


I would like to be able to enable it in LabVIEW. How would it be presented in LabVIEW?

0 Kudos
Message 4 of 18
(1,527 Views)

@Christina_R wrote:

The Open Python Session function now takes an optional parameter for the path to the Python executable:

 


Does this mean that you would point LabVIEW to use Python Virtual Environment you have setup somewhere else on disk?

0 Kudos
Message 5 of 18
(1,525 Views)

@Eisenwr wrote:

@Christina_R wrote:

Do you think this functionality is useful enough that it should be presented in the LabVIEW editor?


I would like to be able to enable it in LabVIEW. How would it be presented in LabVIEW?


We don't currently have a plan in place, so I'd like to hear your thoughts. Perhaps a checkbox in Tools»Options?


Christina Rogers
Product Owner, LabVIEW R&D
0 Kudos
Message 6 of 18
(1,475 Views)

@Eisenwr wrote:

@Christina_R wrote:

The Open Python Session function now takes an optional parameter for the path to the Python executable:


Does this mean that you would point LabVIEW to use Python Virtual Environment you have setup somewhere else on disk?


Currently, LabVIEW does not fully support Python virtual environments, but we're considering it for a future release.


Christina Rogers
Product Owner, LabVIEW R&D
0 Kudos
Message 7 of 18
(1,403 Views)

@Christina_R wrote:

@Eisenwr wrote:

@Christina_R wrote:

Do you think this functionality is useful enough that it should be presented in the LabVIEW editor?


I would like to be able to enable it in LabVIEW. How would it be presented in LabVIEW?


We don't currently have a plan in place, so I'd like to hear your thoughts. Perhaps a checkbox in Tools»Options?


That would be the absolute minimum. I am thinking it is setting that people would want to dynamically change. I would prefer it to be an optional input to the Open Python Session VI.

0 Kudos
Message 8 of 18
(1,341 Views)

@Christina_R wrote:

@Eisenwr wrote:

@Christina_R wrote:

The Open Python Session function now takes an optional parameter for the path to the Python executable:


Does this mean that you would point LabVIEW to use Python Virtual Environment you have setup somewhere else on disk?


Currently, LabVIEW does not fully support Python virtual environments, but we're considering it for a future release.


Is this feature expected to be used currently to help when python is not in the system path directories?

0 Kudos
Message 9 of 18
(1,339 Views)

Labview 2021 example C:\Program Files\National Instruments\LabVIEW 2021\examples\Connectivity\Python\support\NumpyExampleModule.py returns error

Python Node in PythonNode_NumpyMatmul.vi<APPEND>

Python returned the following error: Numpy package not installed.

 

 

Tried debugging since numpy package is actually installed  using using the feature ShowConsoleForPythonNode=TRUE

and got this message

 

UserWarning: mkl-service package failed to import, therefore Intel(R) MKL initialization ensuring its correct out-of-the box operation under condition when Gnu OpenMP had already been loaded by Python process is not assured. Please install mkl-service package, see http://github.com/IntelPython/mkl-service
from . import _distributor_init

 

Installed mkl-service package as suggested by error message but no luck.

 

 

0 Kudos
Message 10 of 18
(1,308 Views)