Import python library

How I can Import external python library by custom script

1 Like

i need too

1 Like

me too

It is currently not possible to import a Python library in Server Scripts, mainly for security reasons.

However, it is possible to import anything inside a custom application. You have to:

  1. Create a custom application that will be installed alongside Frappe, ERPNext, HRMS, etc.
  2. Add your dependencies (specific non-standard Python libraries) in the pyproject.toml file.
  3. Write the code in a file (that is currently in a server script)
  4. Call the code from outside: from a hook, as a REST API (when frappe.whitelisted), from a server script (with frappe.call), …