
- Python Basic Tutorial
- Python - Home
- Python - Overview
- Python - Environment Setup
- Python - Basic Syntax
- Python - Comments
- Python - Variables
- Python - Data Types
- Python - Operators
- Python - Decision Making
- Python - Loops
- Python - Numbers
- Python - Strings
- Python - Lists
- Python - Tuples
- Python - Dictionary
- Python - Date & Time
- Python - Functions
- Python - Modules
- Python - Files I/O
- Python - Exceptions
How do I find the location of my Python site-packages directory?
You can find the location of Python site-packages directory by using the site module in the following way −
>>> import site >>> site.getsitepackages() ['/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages']
If you want the per user site packages directory, then run the following code in your shell −
$ python -m site --user-site
- Related Articles
- How do I find the location of Python module sources?
- How do I Install Python Packages in Anaconda?
- How do I get the parent directory in Python?
- How do I list all files of a directory in Python?
- How to find the location of installed packages in R in windows operating system?
- How do I check what version of Python is running my script?
- How do I determine the size of my array in C#
- My Python program is too slow. How do I speed it up?
- How to select a directory and store the location using Tkinter in Python?
- How do I redirect my web page with JavaScript?
- How do I make my string comparison case insensitive?
- How Do I Promote My Business Through Digital Marketing?
- PHP: How do I display the contents of a textfile on my page?
- How do I let my Matplotlib plot go beyond the axes?
- How can I list the contents of a directory in Python?

Advertisements