【发布时间】:2015-02-14 04:14:36
【问题描述】:
尝试在 Mac OS X 10.9 上使用 Homebrew 来安装 mercurial 并确保它使用的是 homebrew python 版本。
我已将/etc/paths 更新为在/usr/bin 之前列出/usr/local/bin。
使用brew install python 安装了python 2.7.9,python 可执行文件位于/usr/local/bin/python,它是/usr/local/Cellar/python/2.7.9/bin/python 的符号链接。
当我输入which python 或python -V 时,我得到的是自制python 版本。
后来,当我运行brew install mercurial时,安装的文件/usr/local/bin/hgshebang(#!)指向系统python/usr/bin/python。
发生这种情况是因为 mercurial python 包安装程序 (distutils) 使用 PATH 变量在 shebang 中硬编码 python 的路径,而不是 #!/usr/bin/env python。
当我检查我的 PATH 环境变量时,我在 /usr/bin 之前看到了 /usr/local/bin,但如果我尝试以交互方式安装 brew 包:brew install -i mercurial 我得到一个带有不同 PATH 变量的 shell,根本没有 /usr/local/bin。
如何安装 mercurial 以确保它使用自制版本的 python ? 我更喜欢一种能够在不断变化的软件包升级中幸存下来的方法。
【问题讨论】:
-
为什么要 mercurial 使用 Homebrew 的 python?
标签: python macos path mercurial homebrew