12-20-2024 09:28 AM
I'm using Python along with the Microsoft MSAL library to access a SharePoint site via Graph API. As part of the authentication process, Python launches a web browser for the user to sign-in to their Microsoft account, and it listens for a callback on a port (I can specify the number) for the authentication result. This works flawlessly in Python, but when calling the module through the Python Node in LabVIEW, it immediately throws an error that it's unable to listen to the specified port.
Is there any resolution to this issue? Or is this just not possible using the Python Node?
For reference, I'm using LabVIEW 2019 and Python 3.8.10. The MSAL method being used is PublicClientApplication.acquire_token_interactive.
12-20-2024 11:04 AM
Instead of using the Python Node, try calling the Python script directly using the exe VI. This will cause the script to use the Python instance associated with your PATH variable. The advantage of this is that you have more control over the Python environment associated with the PATH. Also, depending on how you are calling the Python script that works, you might be using the same Python environment so it has a better chance of working.
12-20-2024 11:06 AM
You can call the Python module like this