TousifAhamed Nadaf Posted May 28 Share Posted May 28 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 More sharing options...
Gaia Paolini Posted May 28 Share Posted May 28 maybe this article helps? https://docs.tibco.com/pub/sf-pysrv/1.0.1/doc/html/GUID-0394E77D-B9CA-4C32-AB2C-A1E604751811.html Link to comment Share on other sites More sharing options...
TousifAhamed Nadaf Posted May 28 Author Share Posted May 28 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 More sharing options...
David Boot-Olazabal Posted May 28 Share Posted May 28 Hi TousifAhamed, This could be solved by restarting the Spotfire server service (and perhaps the node manager one as well). If not, I would suggest to create a support ticket via https://support.tibco.com. Kind regards, David Link to comment Share on other sites More sharing options...
TousifAhamed Nadaf Posted May 28 Author Share Posted May 28 Sure thank you, actually I tried restarting but it did not work. Did you try in similar way did it work for you? Link to comment Share on other sites More sharing options...
David Boot-Olazabal Posted May 28 Share Posted May 28 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 1 Link to comment Share on other sites More sharing options...
barchiel33 Posted May 28 Share Posted May 28 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 More sharing options...
TousifAhamed Nadaf Posted May 29 Author Share Posted May 29 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 More sharing options...
barchiel33 Posted May 29 Share Posted May 29 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 More sharing options...
Solution TousifAhamed Nadaf Posted May 30 Author Solution Share Posted May 30 Great news! I found a solution by consolidating the custom authenticator code within the data function. After restarting the service, everything functioned as expected. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now