Skip to content

Instantly share code, notes, and snippets.

@bthaman
Last active November 19, 2018 17:02
Show Gist options
  • Save bthaman/5b7c2afe861c903a694c415502bf9f8b to your computer and use it in GitHub Desktop.
Save bthaman/5b7c2afe861c903a694c415502bf9f8b to your computer and use it in GitHub Desktop.
Command to determine where Python searches for packages. Get all the details from https://leemendelowitz.github.io/blog/how-does-python-find-packages.html
import sys
'''
list paths that Python searches for packages.
see https://leemendelowitz.github.io/blog/how-does-python-find-packages.html for the whole story.
an example of a path Python searches are the paths listed in the PYTHONPATH environment variable.
'''
print('\n'.join(sys.path))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment