如何从Python软件包的搜索路径中删除系统的“站点软件包"? [英] How do I remove my system's 'site-packages' from the search path for Python packages?

查看:110
本文介绍了如何从Python软件包的搜索路径中删除系统的“站点软件包"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Python软件包的搜索路径包含一个条目,用于输入系统中的站点软件包

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

/Library/Python/2.7/site-packages

这一直存在,但是现在我已经安装了Homebrew的Python,建议我删除它(假设这是安全且合理),从Homebrew的Python的软件包搜索路径中进行.但是我不确定如何(甚至到达那里:例如,我不将其添加到PYTHONPATH中).

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).

如何从Brew的Python用于软件包的搜索路径中删除系统的site-packages?

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

推荐答案

最简单的选择是在命令行上将-S传递给python,如

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

这篇关于如何从Python软件包的搜索路径中删除系统的“站点软件包"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆