Note. Python has built-in modules, the Python executable, stand-alone, will work fine. You can remove any unnecessary modules, only you (or someone else) to determine which ones are not needed. Remember these dependencies of each module.
Some modules are built-in and therefore always are. For a list of built-in modules, upload the contents of sys.builtin_module_names .
Ex, with the standalone Python 3.4.1 executable compiled on the Ubuntu platform:
>>> import sys >>> for m in sys.builtin_module_names: print(m)
It says:
_ast_codecs_collections_functools_imp_io_locale_operator_sre_stat_string_symtable_thread_tracemalloc_warnings_weakrefatexitbuiltinserrnofaulthandlergcitertoolsmarshalposixpwdsignalsysxxsubtypezipimport
There are private modules, and another 13 publicly available modules. Everything is embedded in the Python executable, standalone.
As already mentioned, you can delete any *.pyc and *.pyo , since everything is required for the module to work, these are *.py files.
source share