Jump to content

Spotfire 14+ Local Python execution. Any suggestions how to handle this?


Go to solution Solved by TousifAhamed Nadaf,

Recommended Posts

Issue:

  • A Python virtual environment with a specific Python version and required packages works correctly when running locally.
  • However, the script fails to recognize the installed packages when executed from the Spotifire Data Functions option.

Additional Information:

  • The Spotifire library is installed.
Link to comment
Share on other sites

Greetings Gaia,

Thank you for your respose, I am able to install python packages/libraies and also I am able to see them from Tools > Python Tools > Package Management > Installed Packages,
Problem is when I run the data functions it says it is not able to find relevant module, and the python data function code is working fine when I run it via vs code. 

Link to comment
Share on other sites

Unfortunately, it doesn't always fix this.

What I've also seen, is that you can upgrade Python packages in the Python Tools application. That sometimes helped.
But, in my own case, it didn't help. So it's not always a guarantee for a fix.

So what I would suggest, is to create a support ticket, as it seems that the Python engine isn't completely in sync with what has been installed via the Python Tools. If you create that ticket, could you share the number with us, so we can monitor it (and if needed, add information for support)?

Kind regards,

David

  • Like 1
Link to comment
Share on other sites

Would you be able to post the actual Python script that you're using? It's difficult to pinpoint what exactly could be going wrong without seeing the code itself. Does it say specifically which module is not being found? There are some packages that require specific steps to get working properly.

Link to comment
Share on other sites

I'm having trouble with an authentication library. I can successfully use it to authenticate users outside of Spotfire, for example, in Visual Studio Code. However, the authentication fails when I try to use the library within Spotfire through a Data Function. I've also attempted using the Python Script Executor option within Data Functions, but the issue persists.

Link to comment
Share on other sites

Ahhh, authentication is tricky within Spotfire. I'm not 100% certain about this, but I believe that Python data functions have an 'issue' with HTTPS (and similar REST/Web requests) in Spotfire. I'm guessing it's probably a security thing or something. You might be able to accomplish what you want via IronPython instead, have you given that a try? I managed to find this script: 

 but I can't vouch for its effectiveness since I haven't tried it before. Could you tell me which library you're trying to use?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...