diagnose.py 379 B

123456789101112131415161718192021
  1. import sys
  2. from . import Distribution
  3. def inspect(path):
  4. print("Inspecting", path)
  5. dists = list(Distribution.discover(path=[path]))
  6. if not dists:
  7. return
  8. print("Found", len(dists), "packages:", end=' ')
  9. print(', '.join(dist.name for dist in dists))
  10. def run():
  11. for path in sys.path:
  12. inspect(path)
  13. if __name__ == '__main__':
  14. run()