You can set the default module search path in Python using the sys.path list. The sys.path list specifies the directories that Python will search for modules and packages.
To add a directory to the default module search path, you can use the append() method of the sys.path list, like this:
import sys sys.path.append('/path/to/directory')
In this example, the directory /path/to/directory will be added to the end of the sys.path list, so that Python will search for modules and packages in that directory.
Note that changes to the sys.path list only affect the current Python process, so if you want to set the default module search path for all Python processes, you need to set the PYTHONPATH environment variable, which will be added to sys.path at start-up.