{
    "content": [
        {
            "type": "text",
            "text": "# site (pydoc)\n\n**Summary:** site - Append module search paths for third-party packages to sys.path.\n\n## Section Outline\n\n- **NAME** (2 lines)\n- **MODULE REFERENCE** (8 lines)\n- **DESCRIPTION** (73 lines)\n- **FUNCTIONS** (1 lines) — 19 subsections\n  - abs_paths (2 lines)\n  - addpackage (4 lines)\n  - addsitedir (3 lines)\n  - addsitepackages (2 lines)\n  - addusersitepackages (5 lines)\n  - check_enableusersite (9 lines)\n  - enablerlcompleter (8 lines)\n  - execsitecustomize (2 lines)\n  - execusercustomize (2 lines)\n  - getsitepackages (6 lines)\n  - getuserbase (6 lines)\n  - getusersitepackages (5 lines)\n  - main (5 lines)\n  - makepath (1 lines)\n  - removeduppaths (3 lines)\n  - setcopyright (2 lines)\n  - sethelper (1 lines)\n  - setquit (5 lines)\n  - venv (1 lines)\n- **DATA** (5 lines)\n- **FILE** (3 lines)\n\n## Full Content\n\n### NAME\n\nsite - Append module search paths for third-party packages to sys.path.\n\n### MODULE REFERENCE\n\nhttps://docs.python.org/3.10/library/site.html\n\nThe following documentation is automatically generated from the Python\nsource files.  It may be incomplete, incorrect or include features that\nare considered implementation detail and may vary between Python\nimplementations.  When in doubt, consult the module reference at the\nlocation listed above.\n\n### DESCRIPTION\n\n* This module is automatically imported during initialization. *\n\n\nThis will append site-specific paths to the module search path.  On\nUnix (including Mac OSX), it starts with sys.prefix and\nsys.execprefix (if different) and appends\nlib/python3/dist-packages.\nOn other platforms (such as Windows), it tries each of the\nprefixes directly, as well as with lib/site-packages appended.  The\nresulting directories, if they exist, are appended to sys.path, and\nalso inspected for path configuration files.\n\nFor Debian and derivatives, this sys.path is augmented with directories\nfor packages distributed within the distribution. Local addons go\ninto /usr/local/lib/python<version>/dist-packages, Debian addons\ninstall into /usr/lib/python3/dist-packages.\n/usr/lib/python<version>/site-packages is not used.\n\nIf a file named \"pyvenv.cfg\" exists one directory above sys.executable,\nsys.prefix and sys.execprefix are set to that directory and\nit is also checked for site-packages (sys.baseprefix and\nsys.baseexecprefix will always be the \"real\" prefixes of the Python\ninstallation). If \"pyvenv.cfg\" (a bootstrap configuration file) contains\nthe key \"include-system-site-packages\" set to anything other than \"false\"\n(case-insensitive), the system-level prefixes will still also be\nsearched for site-packages; otherwise they won't.\n\nAll of the resulting site-specific directories, if they exist, are\nappended to sys.path, and also inspected for path configuration\nfiles.\n\nA path configuration file is a file whose name has the form\n<package>.pth; its contents are additional directories (one per line)\nto be added to sys.path.  Non-existing directories (or\nnon-directories) are never added to sys.path; no directory is added to\nsys.path more than once.  Blank lines and lines beginning with\n'#' are skipped. Lines starting with 'import' are executed.\n\nFor example, suppose sys.prefix and sys.execprefix are set to\n/usr/local and there is a directory /usr/local/lib/python2.5/site-packages\nwith three subdirectories, foo, bar and spam, and two path\nconfiguration files, foo.pth and bar.pth.  Assume foo.pth contains the\nfollowing:\n\n# foo package configuration\nfoo\nbar\nbletch\n\nand bar.pth contains:\n\n# bar package configuration\nbar\n\nThen the following directories are added to sys.path, in this order:\n\n/usr/local/lib/python2.5/site-packages/bar\n/usr/local/lib/python2.5/site-packages/foo\n\nNote that bletch is omitted because it doesn't exist; bar precedes foo\nbecause bar.pth comes alphabetically before foo.pth; and spam is\nomitted because it is not mentioned in either path configuration file.\n\nThe readline module is also automatically configured to enable\ncompletion for systems that support it.  This can be overridden in\nsitecustomize, usercustomize or PYTHONSTARTUP.  Starting Python in\nisolated mode (-I) disables automatic readline configuration.\n\nAfter these operations, an attempt is made to import a module\nnamed sitecustomize, which can perform arbitrary additional\nsite-specific customizations.  If this import fails with an\nImportError exception, it is silently ignored.\n\n### FUNCTIONS\n\n#### abs_paths\n\nSet all module file and cached attributes to an absolute path\n\n#### addpackage\n\nProcess a .pth file within the site-packages directory:\nFor each line in the file, either combine it with sitedir to a path\nand add that to knownpaths, or execute it if it starts with 'import '.\n\n#### addsitedir\n\nAdd 'sitedir' argument to sys.path if missing and handle .pth files in\n'sitedir'\n\n#### addsitepackages\n\nAdd site-packages to sys.path\n\n#### addusersitepackages\n\nAdd a per user site-package to sys.path\n\nEach user has its own python directory with site-packages in the\nhome directory.\n\n#### check_enableusersite\n\nCheck if user site directory is safe for inclusion\n\nThe function tests for the command line flag (including environment var),\nprocess uid/gid equal to effective uid/gid.\n\nNone: Disabled for security reasons\nFalse: Disabled by user (command line option)\nTrue: Safe and enabled\n\n#### enablerlcompleter\n\nEnable default readline configuration on interactive prompts, by\nregistering a sys.interactivehook.\n\nIf the readline module can be imported, the hook will set the Tab key\nas completion key and register ~/.pythonhistory as history file.\nThis can be overridden in the sitecustomize or usercustomize module,\nor in a PYTHONSTARTUP file.\n\n#### execsitecustomize\n\nRun custom site specific code, if available.\n\n#### execusercustomize\n\nRun custom user specific code, if available.\n\n#### getsitepackages\n\nReturns a list containing all global site-packages directories.\n\nFor each directory present in ``prefixes`` (or the global ``PREFIXES``),\nthis function will find its `site-packages` subdirectory depending on the\nsystem environment, and will return a list of full paths.\n\n#### getuserbase\n\nReturns the `user base` directory path.\n\nThe `user base` directory can be used to store data. If the global\nvariable ``USERBASE`` is not initialized yet, this function will also set\nit.\n\n#### getusersitepackages\n\nReturns the user-specific site-packages directory path.\n\nIf the global variable ``USERSITE`` is not initialized yet, this\nfunction will also set it.\n\n#### main\n\nAdd standard site-specific directories to the module search path.\n\nThis function is called automatically when this module is imported,\nunless the python interpreter was started with the -S flag.\n\n#### makepath\n\n#### removeduppaths\n\nRemove duplicate entries from sys.path along with making them\nabsolute\n\n#### setcopyright\n\nSet 'copyright' and 'credits' in builtins\n\n#### sethelper\n\n#### setquit\n\nDefine new builtins 'quit' and 'exit'.\n\nThese are objects which make the interpreter exit when called.\nThe repr of each object contains a hint at how it works.\n\n#### venv\n\n### DATA\n\nENABLEUSERSITE = True\nPREFIXES = ['/usr', '/usr']\nUSERBASE = '/home/chedong/.local'\nUSERSITE = '/home/chedong/.local/lib/python3.10/site-packages'\n\n### FILE\n\n/usr/lib/python3.10/site.py\n\n"
        }
    ],
    "structuredContent": {
        "command": "site",
        "section": "",
        "mode": "pydoc",
        "summary": "site - Append module search paths for third-party packages to sys.path.",
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "MODULE REFERENCE",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 73,
                "subsections": []
            },
            {
                "name": "FUNCTIONS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "abs_paths",
                        "lines": 2
                    },
                    {
                        "name": "addpackage",
                        "lines": 4
                    },
                    {
                        "name": "addsitedir",
                        "lines": 3
                    },
                    {
                        "name": "addsitepackages",
                        "lines": 2
                    },
                    {
                        "name": "addusersitepackages",
                        "lines": 5
                    },
                    {
                        "name": "check_enableusersite",
                        "lines": 9
                    },
                    {
                        "name": "enablerlcompleter",
                        "lines": 8
                    },
                    {
                        "name": "execsitecustomize",
                        "lines": 2
                    },
                    {
                        "name": "execusercustomize",
                        "lines": 2
                    },
                    {
                        "name": "getsitepackages",
                        "lines": 6
                    },
                    {
                        "name": "getuserbase",
                        "lines": 6
                    },
                    {
                        "name": "getusersitepackages",
                        "lines": 5
                    },
                    {
                        "name": "main",
                        "lines": 5
                    },
                    {
                        "name": "makepath",
                        "lines": 1
                    },
                    {
                        "name": "removeduppaths",
                        "lines": 3
                    },
                    {
                        "name": "setcopyright",
                        "lines": 2
                    },
                    {
                        "name": "sethelper",
                        "lines": 1
                    },
                    {
                        "name": "setquit",
                        "lines": 5
                    },
                    {
                        "name": "venv",
                        "lines": 1
                    }
                ]
            },
            {
                "name": "DATA",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "FILE",
                "lines": 3,
                "subsections": []
            }
        ]
    }
}