Python Module Not Found Error

Updated Jun 18, 2024

Reported In

Software

  • LabVIEW 2018

Programming Language

  • Python

Issue Details

I am using Python and my executable can't find the function definition in the Python file. 

Solution

If your LabVIEW application cannot run a python script, take the follow steps: 
  • Make sure the file is in the specified path. It is also a good idea to use relative file paths in your application. Using relative paths will also make your application portable between systems.
  • If the file is in the correct path, make sure that the function is properly defined. If the function is not defined properly, then the LabVIEW application will throw an error.
  • Finally, check to make sure your environment path is correct. A standard python installation will setup the correct environment variables. You can resolve environment issues by reinstalling python, or by adding an environment variable to link the Python libraries to the scripts. 

Additional Information

Support for Python sessions was added in LabVIEW 2018. If you do not have LabVIEW 2018, Perl and Python Scripts can be called from LabVIEW using the System Exec VI.