Golian
Golian

Reputation: 43

Remove entry from sys.path

After installing some Python Modules via homebrew, homebrew told me to run the following code. I don't need those modules anymore and want to cleanup everything. Can i remove (should i?) remove this entry? And how i remove it?

Python modules have been installed and Homebrew's site-packages is not in your Python sys.path, so you will not be able to import the modules this formula installed. If you plan to develop with these modules, please run:

mkdir -p /Users/rain/.local/lib/python2.7/site-packages
echo 'import site; site.addsitedir("/usr/local/lib/python2.7/site-packages")' >> /Users/USERNAME/.local/lib/python2.7/site-packages/homebrew.pth

Mac OsX 10.10.2

Upvotes: 4

Views: 3189

Answers (1)

Tim Smith
Tim Smith

Reputation: 6349

You can safely delete /Users/USERNAME/.local/lib/python2.7/site-packages/homebrew.pth if you aren't using any Homebrew-installed python modules.

.pth files are a way of adding paths to sys.path. Lines in a .pth file which are paths are added to sys.path; lines in a .pth file starting with import are executed.

The line starting with import in the homebrew.pth file makes the site-packages directory under the Homebrew prefix a special site-packages directory, which both adds it to sys.path and ensures that any .pth files that it contains are read and processed.

Upvotes: 3

Related Questions