Error 1748 Occurred at Open Python Session in LabVIEW

Updated Oct 25, 2023

Reported In

Software

  • LabVIEW

Issue Details

I am trying to run a Python script in LabVIEW 2023 using the Python functions, but I get the following error:

Error 1748 occurred at Open Python Session in <VI name>

Possible reason(s):
LabVIEW: (Hex 0x6D4) PythonStartScript was not found. It may have been deleted or not installed correctly.


error.JPG
 

Solution

This can happen in LabVIEW 2023 if it cannot find the PythonStartScript.py file, which is required for the LabVIEW Python functions to be executed correctly. Try the following suggestions to make sure LabVIEW can find this file:
  • Verify that the PythonStartScript.py file is located at:
    • C:\<Program Files>\National Instruments\Shared\NIPythonInterface
    • C:\<Program Files>\National Instruments\LabVIEW 2023\resource
      • Use Program Files if you are using a 64-bit LabVIEW version and Program Files (x86)for 32-bit LabVIEW.
  • If the file is not found, try to repair LabVIEW.
  • If the file is located at the expected locations, make sure you don't have a copy of the niPythonInterface.dll and niPythonHost.exe files in the C:\<Program Files>\National Instruments\LabVIEW 2023 folder, this could force LabVIEW to look for the PythonStartScript.py in an incorrect path resulting in the 1748 error.

Additional Information

LabVIEW uses the niPythonInterface.dll and niPythonHost.exe files as part of the NI Python Interface necessary to run the Python functions, these should be located in the C:\<Program Files>\National Instruments\Shared\NIPythonInterface folder, copying these files to another folder can cause a path issue as LabVIEW tries to load the PythonStartScript.py from the location where the other two files were copied to.