1, need to find out where the Python interpreter to find the module;
Specific methods:
>>> Import Sys,pprint
>>> Pprint.pprint (Sys.path)
[‘‘,
' C:\\python27\\lib\\site-packages\\jinja2-2.8-py2.7.egg ',
' C:\\python27\\lib\\site-packages\\markupsafe-0.23-py2.7.egg ',
' C:\\python27\\lib\\site-packages\\mysql_connector_python-2.0.4-py2.7.egg ',
' C:\\windows\\system32\\python27.zip ',
' C:\\python27\\dlls ',
' C:\\python27\\lib ',
' C:\\python27\\lib\\plat-win ',
' C:\\python27\\lib\\lib-tk ',
' C:\\python27 ',
' C:\\python27\\lib\\site-packages ']
Put your. py file in any directory
' C:\\python27\\lib\\site-packages ' This is the best choice,
2, customize the location, let the Python interpreter automatically need to find a custom module
Python contains the directory where the module resides in Add environment variables.
Python Custom Module Location