On this page
site.main
Prev: site.getusersitepackages | Up: site | Next: site.makepath
Rel: site.abs_paths, site.addpackage, site.addsitedir, site.addsitepackages
Ref: docs.python.org — site.main
Tags: #public #python3 #stdlib #site
Import
import site
from site import main
Signature & Overview
site.main()
Add standard site-specific directories to the module search path.
Usage
import site
# Entry point executed automatically on interpreter startup (also `python3 -m site`)
assert callable(site.main)
Gotchas
- Run
python3 -m sitefrom a terminal to debugsys.pathand venv setup.
REPL Inspect
from site import main
help(main)
Linked from
Related notes
- tuts/python3/stdlib_module/site/getusersitepackages Linked here; links to this page; shared tags: #site, #stdlib
- tuts/python3/stdlib_module/site/makepath Linked here; links to this page; shared tags: #site, #stdlib
- tuts/python3/stdlib_module/site Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/site/abs_paths Linked here; shared tags: #site, #stdlib
- tuts/python3/stdlib_module/site/addpackage Linked here; shared tags: #site, #stdlib
- tuts/python3/stdlib_module/site/addsitedir Linked here; shared tags: #site, #stdlib
- tuts/python3/stdlib_module/site/addsitepackages Linked here; shared tags: #site, #stdlib
- tuts/python3/stdlib_module/site/addusersitepackages shared tags: #site, #stdlib
- tuts/python3/stdlib_module/site/check_enableusersite shared tags: #site, #stdlib
- tuts/python3/stdlib_module/site/enablerlcompleter shared tags: #site, #stdlib