Menu Close

How to find the location of my Python site-packages directory?

Sometimes, we want to find the location of my Python site-packages directory.

In this article, we’ll look at how to find the location of my Python site-packages directory.

How to find the location of my Python site-packages directory?

To find the location of my Python site-packages directory, we can call the site.getsitepackages method.

For instance, we write

import site

l = site.getsitepackages()

to call site.getsitepackages to return a list of package directory paths.

Conclusion

To find the location of my Python site-packages directory, we can call the site.getsitepackages method.

Posted in Python, Python Answers