I want to import my custom written functions in any script on any directory, just like I import requests module in any script. I am running Ubuntu and Python 3.9
>Solution :
You could make a simple package of your custom functions and then just install the package in your system locally using pip. After this you will be able to import the functions from any script.
# for example
pip install .
# or if you need to edit your functions install in editable mode
pip install -e .
Note: the dot ‘.’ above indicates that your setup.py is located in the current working directory. You can also provide the path to the setup.py for your package instead of the dot.
Reference on creating package: How to write a Python module/package?