Lost in Python

Tags

  • py

Sometimes a random shortcut link, Python package or data directory goes E050, so you look for it.

import site
print('Site packages ahoy', site.getsitepackages())
print('Site prefixes ahoy', site.PREFIXES)
print('User-specific site', site.USER_SITE)

import sys
print('All the places I am looking for things include', sys.path)
print('Yeah but where is the virtual env?', sys.prefix)
print('Yeah but where is the original Python?', sys.base_prefix)
print('Where is this module tho?', sys.__file__)

Fun tidbit: why per-user site packages exist.