MCPcopy Index your code
hub / github.com/python/cpython / addusersitepackages

Function addusersitepackages

Lib/site.py:367–380  ·  view source on GitHub ↗

Add a per user site-package to sys.path Each user has its own python directory with site-packages in the home directory.

(known_paths)

Source from the content-addressed store, hash-verified

365 return USER_SITE
366
367def addusersitepackages(known_paths):
368 """Add a per user site-package to sys.path
369
370 Each user has its own python directory with site-packages in the
371 home directory.
372 """
373 # get the per user site-package path
374 # this call will also make sure USER_BASE and USER_SITE are set
375 _trace("Processing user site-packages")
376 user_site = getusersitepackages()
377
378 if ENABLE_USER_SITE and os.path.isdir(user_site):
379 addsitedir(user_site, known_paths)
380 return known_paths
381
382def getsitepackages(prefixes=None):
383 """Returns a list containing all global site-packages directories.

Callers 1

mainFunction · 0.85

Calls 4

_traceFunction · 0.85
getusersitepackagesFunction · 0.85
addsitedirFunction · 0.85
isdirMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…