Trouble with SKlearn in server

What I’m trying to do:

I have a SKlearn Vectorizer that I am trying to load into a server function. I am able to do so with no issues in local jupter notebook, but when I try calling the Vectorizer to vectorize an input, I get the following error:

AttributeError: ‘LinearSVC’ object has no attribute 'transform’at [ServerModule1, line 40](javascript:void(0))called from /downlink/anvil/, line 1469

I know this to be incorrect because TfidfVectorizer certainly has a transform argument.

I have to imagine that this issue is arising from SKlearn not being properly installed in the Anvil servers?

What I’ve tried and what’s not working:

I have checked to make sure that the vectorizer, which I load from a pickle file stored as a media object in a datatable is loaded correctly, and indeed it has (its type is class ‘sklearn.feature_extraction.text.TfidfVectorizer’).

Code Sample:

# this is a formatted code snippet.
# paste your code between ``` 

Clone link:
share a copy of your app

You can explore a little deeper by playing with it on your computer (assuming you have an environment with SKlearn on your computer) and on the server console, then compare the behaviors of the two environments.

You can open an app console by clicking on this button on the bottom right corner of the Beta Editor:

Here is an example of server console session:

Thanks for the suggestion, Stefano. I will try this.

Upon further investigation, I found a post by someone who encountered a similar error when trying to load an attribute from a package that had been recently upgraded by Anvil. I am going to report this as a likely bug. Plotly Errors occuring