node2:/root#cat a1.py
import sys
print sys.path
import mymodule
node2:/root#
node2:/root#python a1.py
['/root', '/usr/local/python27/lib/python27.zip', '/usr/local/python27/lib/python2.7', '/usr/local/python27/lib/python2.7/plat-linux2', '/usr/local/python27/lib/python2.7/lib-tk', '/usr/local/python27/lib/python2.7/lib-old', '/usr/local/python27/lib/python2.7/lib-dynload', '/usr/local/python27/lib/python2.7/site-packages', '/usr/local/python27/lib/python2.7/site-packages/setuptools-33.1.1-py2.7.egg', '/usr/local/python27/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg', '/usr/local/python27/lib/python2.7/site-packages/MySQL_python-1.2.5-py2.7-linux-x86_64.egg', '/usr/local/python27/lib/python2.7/site-packages/dwebsocket-0.4.2-py2.7.egg', '/usr/local/python27/lib/python2.7/site-packages/requests_toolbelt-0.8.0-py2.7.egg', '/usr/local/python27/lib/python2.7/site-packages/certifi-2018.4.16-py2.7.egg']
Traceback (most recent call last):
File "a1.py", line 3, in <module>
import mymodule
ImportError: No module named mymodule
node2:/root#cat a1.py
import sys
print sys.path
sys.path.append('/root/python')
import mymodule
print mymodule.Str