Returns the user-specific site-packages directory path. If the global variable ``USER_SITE`` is not initialized yet, this function will also set it.
()
| 322 | |
| 323 | |
| 324 | def 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 | |
| 341 | def addusersitepackages(known_paths): |
| 342 | """Add a per user site-package to sys.path |
no test coverage detected