Categories
Python Answers

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

Spread the love

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.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *