Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago

Python script works in local but fails after publishing

Hello there, 

 

I have written some Py scripts and they work fine on the Desktop version, after publishing I am reciving this error, any idea how to solve this:

 

ImportError: cannot import name 'Function name' from 'Package' (C:\Python\lib\site-packages\...\__init__.py)

 

The exact error is shown below:

 

 

 

 

Activity ID: b6476dd7-1d82-4875-838a-33d03abd797e
Request ID: b50b4041-797f-591a-586c-73eec2b8d6e7
Correlation ID: 89779efe-d96d-89b7-0a44-6b57bb794946
Time: Wed May 25 2022 09:51:33 GMT+1200 (New Zealand Standard Time)
Service version: 13.0.18310.53
Client version: 2205.3.11455-train
Cluster URI: https://wabi-south-east-asia-redirect.analysis.windows.net/

 

Part of my code:

 

from sklearn.metrics import mean_absolute_percentage_error
from numpy import mean
from numpy import std
from numpy.random import randn
 

Thanks

M

3 Replies

  • reinstall the sklearn package.  Update to the latest version of the personal gateway.  (also validate if sklearn is even supported by the gateway)

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi  Anonymous ,

    Whether your problem has been resolved? If yes, could you please mark the helpful post as Answered? It will help the others in the community find the solution easily if they face the same problem as yours. Thank you.

    Best Regards

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Rena, Thanks for checking, these steps did not solve the problem, I am not using the gateway, so I am still lookign for other solutions.

       

      Thanks,

      M