MCPcopy Create free account
hub / github.com/RT-Thread/env-windows / addusersitepackages

Function addusersitepackages

tools/python-3.11.9-amd64/Lib/site.py:341–354  ·  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

339 return USER_SITE
340
341def addusersitepackages(known_paths):
342 """Add a per user site-package to sys.path
343
344 Each user has its own python directory with site-packages in the
345 home directory.
346 """
347 # get the per user site-package path
348 # this call will also make sure USER_BASE and USER_SITE are set
349 _trace("Processing user site-packages")
350 user_site = getusersitepackages()
351
352 if ENABLE_USER_SITE and os.path.isdir(user_site):
353 addsitedir(user_site, known_paths)
354 return known_paths
355
356def getsitepackages(prefixes=None):
357 """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