How to import external library while writing server script?

I am trying to import external libraries in one my apis, but it is giving an error that says can not find imported module

Hi @Anas_Saifi1,

Import package does not work on the server script doctype.

Rewrite the content in simpler terms for ERPNext:

Also, make sure to understand how the API functions on the server side.

Thank You!

Thank You so much for replying.
I am not working in local development environment or on some IDE, our application is deployed on cloud and I am writing code there directly. In such case how do I create a custom app as you mentioned earlier? I must use external libraries for my api to work.