brew安装python,但是:“已经安装了python-2.7.6,它只是没有链接”

时间:2021-05-23 12:48:01

disclaimer: noob

免责声明:noob

OSX 10.8.5

OSX 10.8.5

When I installed python in bash I got this warning and error:

当我在bash中安装python时,我得到了这个警告和错误:

Warning: Could not link python. Unlinking...
Error: The 'brew link' step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using 'brew link python

So I went ahead and typed

所以我继续打字

brew link python

and got

得到了

Linking /usr/local/Cellar/python/2.7.6... Warning: Could not link python. Unlinking...

Error: Could not symlink file: /usr/local/Cellar/python/2.7.6/bin/smtpd2.py 
Target /usr/local/bin/smtpd2.py already exists. You may need to delete it. 
To force the link and overwrite all other conflicting files, do:

brew link --overwrite formula_name

Should I do it? What does is mean to link python in this context, let alone force-link it, and what's formula_name?

我应该这样做吗?在这种情况下链接python是什么意思,更不用说强制链接它了,什么是formula_name?

This question is similar but also different, so I'm afraid to try the top rated answer as it might just dig me deeper into the rabbit hole that I am stuck in right now.

这个问题很相似,但也有所不同,所以我害怕尝试最受好评的答案,因为它可能会让我深入挖掘我现在陷入困境的兔子洞。

1 个解决方案

#1


50  

It looks like you have installed Python using another method before. Don't be scared. Homebrew is engineered so it won't mess up your system like Mac Ports et al.

看起来您之前使用其他方法安装了Python。不要害怕。 Homebrew经过精心设计,因此不会像Mac Ports等人那样搞乱你的系统。

You can always do brew link --overwrite --dry-run python to see first what exactly will be overwritten, without actually doing it.

你总是可以做brew链接--overwrite --dry-run python,先看看究竟会覆盖什么,而不是真正做到。

If once you do this it look like it is only overwriting or deleting *.py scripts, then you should be even less scared.

如果你这样做,它看起来只是覆盖或删除* .py脚本,那么你应该不那么害怕。

#1


50  

It looks like you have installed Python using another method before. Don't be scared. Homebrew is engineered so it won't mess up your system like Mac Ports et al.

看起来您之前使用其他方法安装了Python。不要害怕。 Homebrew经过精心设计,因此不会像Mac Ports等人那样搞乱你的系统。

You can always do brew link --overwrite --dry-run python to see first what exactly will be overwritten, without actually doing it.

你总是可以做brew链接--overwrite --dry-run python,先看看究竟会覆盖什么,而不是真正做到。

If once you do this it look like it is only overwriting or deleting *.py scripts, then you should be even less scared.

如果你这样做,它看起来只是覆盖或删除* .py脚本,那么你应该不那么害怕。