How do I remove my system's 'site-packages' from the search path for Python packages?

我们两清 提交于 2019-12-12 19:08:48

问题


My search path for Python packages contains an entry for my system's site packages in

/Library/Python/2.7/site-packages

This has always been there, but now that I have installed Homebrew's Python, it has been suggested that I remove it (assuming this is safe and makes sense) from the package search path for Homebrew's Python. But I'm not sure how (or how it even gets there: I don't add it to PYTHONPATH, for example).

How do I remove my system's site-packages from the search path that Brew's Python uses for packages?


回答1:


The easiest option is to pass -S to python on the command line, as described in the documentation.



来源:https://stackoverflow.com/questions/27969220/how-do-i-remove-my-systems-site-packages-from-the-search-path-for-python-pack

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!