安装了多个版本的 Mercurial - 如何将一个版本设置为默认版本
我的 Mac OS 10.6.6 上安装了两个版本的 Mercurial,我想默认使用其中之一。
我使用此处的二进制文件安装了mercurial。 尽管我主要使用 Python 2.7,但我一直在安装时使用 hg
命令从终端运行 Mercurial
/Library/Python/2.6/site-packages
。
附带说明一下,位于 的另一个 Python 2.6 site-packages 目录
/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python2.6/site-packages
没有安装 Mercurial。
在 2.6 中使用 Mercurial,而其他一切都主要使用 2.7,最后终于赶上了我。 (参见这个线程。)
我已经为Python 2.7安装了mercurial(使用pip,而不是网站上的二进制文件),
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/
但是我不确定如何指示 hg
命令默认应使用哪个 Mercurial。它现在使用的是原来的 2.6 版本,我想从现在开始使用更新的 2.7 版本。
I have two versions of mercurial installed on my Mac OS 10.6.6 and I want to use one of them by default.
I installed mercurial with a binary from here. I have been running mercurial from the terminal with the hg
command as it is installed in
/Library/Python/2.6/site-packages
even though I mostly use Python 2.7.
As a side note, the other Python 2.6 site-packages directory located at
/System/Library/Frameworks/Python.framework/Versions/2.6/Extras/lib/python2.6/site-packages
did not have mercurial installed.
Using mercurial with 2.6 while mostly using 2.7 for everything else finally caught up to me. (See this thread.)
I have since installed mercurial (with pip, not the binary from the website) for Python 2.7 in
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/
but I'm not sure how to indicate which mercurial the hg
command should use by default. It is using the original 2.6 one right now and I want to use the newer, 2.7 one from now on.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Virtualenv 将是您的最佳解决方案。
http://stevelosh.com/blog/2009/06/ how-to-contribute-to-mercurial/
请参阅该链接。省略贡献部分。只需创建一个虚拟环境,而不是执行 ln -s 命令,而是在其中执行 pip install Mercurial 。其余的应该可以正常工作。
Virtualenv would be a best solution for you.
http://stevelosh.com/blog/2009/06/how-to-contribute-to-mercurial/
See that link. Leave out the contributing part. Just create a virtual env and instead of doing the ln -s commands, do a pip install mercurial there. And the rest should work fine.
没关系 - 在最后几分钟我到处寻找
hg
命令。它发现它们
是由前段时间从网站下载的二进制文件放在那里的,并且
是今天我用 pip 安装时创建的。
所以我只是将
/usr/local/bin/hg
重命名为/usr/local/bin/hg-2.6
并符号链接/usr/local/bin/hg
到/Library/Frameworks/Python.framework/Versions/2.7/bin/hg
。Never mind - in the last few minutes I looked all over for the
hg
command.It found them in
which was put there by the binary downloaded from the website some time ago, and
which was created today when I installed with
pip
.So I just renamed
/usr/local/bin/hg
to/usr/local/bin/hg-2.6
and symlinked/usr/local/bin/hg
to/Library/Frameworks/Python.framework/Versions/2.7/bin/hg
.