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

Function getusersitepackages

tools/python-3.11.9-amd64/Lib/site.py:324–339  ·  view source on GitHub ↗

Returns the user-specific site-packages directory path. If the global variable ``USER_SITE`` is not initialized yet, this function will also set it.

()

Source from the content-addressed store, hash-verified

322
323
324def getusersitepackages():
325 """Returns the user-specific site-packages directory path.
326
327 If the global variable ``USER_SITE`` is not initialized yet, this
328 function will also set it.
329 """
330 global USER_SITE, ENABLE_USER_SITE
331 userbase = getuserbase() # this will also set USER_BASE
332
333 if USER_SITE is None:
334 if userbase is None:
335 ENABLE_USER_SITE = False # disable user site and return None
336 else:
337 USER_SITE = _get_path(userbase)
338
339 return USER_SITE
340
341def addusersitepackages(known_paths):
342 """Add a per user site-package to sys.path

Callers 2

addusersitepackagesFunction · 0.85
_scriptFunction · 0.85

Calls 2

getuserbaseFunction · 0.85
_get_pathFunction · 0.85

Tested by

no test coverage detected