通过自制软件安装一些Python模块后,homebrew告诉我运行以下代码.
我不再需要那些模块了,想要清理一切.我可以删除(我应该吗?)删除此条目?我怎么删除它?
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
解决方法:
如果您没有使用任何Homebrew安装的python模块,您可以安全地删除/Users/USERNAME/.local/lib/python2.7/site-packages/homebrew.pth.
.pth文件是一种向sys.path添加路径的方法.作为路径的.pth文件中的行被添加到sys.path;执行以import开头的.pth文件中的行.
homebrew.pth文件中以import开头的行使得Homebrew前缀下的site-packages目录成为一个特殊的site-packages目录,它将它们添加到sys.path并确保读取和处理它包含的任何.pth文件.