sys.path 的 python easy_install.pth
我查看了 /usr/local/lib/python2.6/dist-packages
中的 easy_install.pth 文件,我认为这是我通过 easy_install 下载软件包时的默认目录。在 easy_install.pth 中,条目之一是目录本身,即 /usr/local/lib/python2.6/dist-packages
。但是,当我检查 sys.path 时,路径本身不包含 /usr/local/lib/python2.6/dist-packages
。
我这么说只是因为我下载了一个包,并认为只需将其放入 /usr/local/lib/python2.6/dist-packages
目录即可使用它。
I looked at my easy_install.pth file in /usr/local/lib/python2.6/dist-packages
, which I think is the default directory when I download packages via easy_install. Inside easy_install.pth, one of the entry is the directory itself, i.e /usr/local/lib/python2.6/dist-packages
. However, when I check sys.path, /usr/local/lib/python2.6/dist-packages
is not included in the path itself.
I'm only saying this because I downloaded a package and thought I can use it simply by putting it in /usr/local/lib/python2.6/dist-packages
directory.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
easy_install 工具会将其安装在适合您的位置。如果您不或无法以 root 身份运行它,那么您可以将新包放置在您的私人位置。
将安装在您的主目录中。
The easy_install tool installs it in the right place for you. If you don't or can't run it as root then you can place new packages in your private locate.
Will install in your home directory.