Hi @aqilmujahidiin,
Adding the @Dhruvin-Bhaliya answer, In the server script side,
Some import packages and methods does not work.
So please create a custom app and then check it.
Reference Post: How to import python packages? - #2 by NCP
I hope this helps.
Thank You!