How to import a python script

I want to use some functions repeatedly in all problems. Therefore, I was wondering if I can import a module in a python environment in a problem.

For example, in the

 /static/

folder I have two files.

x.py
__init__.py

In a problem, I want to use

<problem>
  <script type="locanpa/python">

import sys
sys.path.insert(0, './static/')

from x import *

...

  </script>

</problem>

However, this returns an error of

ModuleNotFoundError: No module named ...

If I instead in a problem use

<problem>
  <script type="locanpa/python">

from .static.x import *

...

  </script>

</problem>

it will return the error of

KeyError: "'__name__' not in globals"

Can anyone help? thanks.