Where is site-packages located in a Conda environment?

Issue

After installing a package in an Conda environment, I’d like to make some changes to the code in that package.

Where can I find the site-packages directory containing the installed packages?

I have an Anaconda Python 2.7 base distribution, but I do not find a directory:

/Users/username/anaconda/lib/python2.7/site-packages

Solution

You can import the module and check the module.__file__ string. It contains the path to the associated source file.

Alternatively, you can read the File tag in the the module documentation, which can be accessed using help(module), or module? in IPython.

Answered By – Arcturus B

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published