英文:
Running brew doctor shows I have 7 different python “config” scripts installed. How do I get rid of them so that I no longer receive this warning?
问题
我以前在安装Python和链接Python方面遇到过多个问题。最终,我使用了 pyenv
来帮助我管理Python版本。现在的问题是,当我运行 brew doctor
时,它显示了一些配置脚本的警告,如下所示:
警告: “config”脚本存在于您的系统或Homebrew目录之外。
`./configure` 脚本通常会查找 *-config 脚本,以确定是否安装了软件包,并在编译和链接时使用哪些附加标志。
如果在您的路径中有额外的脚本,则可能会导致通过Homebrew安装的软件与系统或Homebrew提供的同名脚本发生冲突。我们发现了以下“config”脚本:
/Users/sensei/.pyenv/shims/python3.7-config
/Users/sensei/.pyenv/shims/python3.7m-config
/Users/sensei/.pyenv/shims/python-config
/Users/sensei/.pyenv/shims/python3-config
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7-config
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7m-config
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3-config
我正在运行Mac Os Mojave,同时也使用了带有Python 3.7.5的pyenv。
请问有人可以帮助我解决/清除这个问题吗?
英文:
I have had multiple issues in the past with installing python and linking it. I finally used pyenv
to help me manage my python version. Now the issue is that when I run brew doctor it shows the warning of several config scripts like so;
Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and which additional flags to use when
compiling and linking.
Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew-provided
script of the same name. We found the following "config" scripts:
/Users/sensei/.pyenv/shims/python3.7-config
/Users/sensei/.pyenv/shims/python3.7m-config
/Users/sensei/.pyenv/shims/python-config
/Users/sensei/.pyenv/shims/python3-config
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7-config
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7m-config
/Library/Frameworks/Python.framework/Versions/3.7/bin/python3-config
>I am running Mac Os Mojave and I am also using pyenv which has python 3.7.5.
Please, can anyone help me fix/ clear this?
答案1
得分: 2
Sure, here's the translated content:
"你的Homebrew安装不知道如何纠正你通过pyenv添加的假装Python安装(这应该是预期的)。尝试将以下内容添加到你的.zshrc
文件中:
alias brew='env PATH="${PATH//$(pyenv root)\/shims:/}" brew'
英文:
your homebrew install doesn't know how to recitify the shimmed python installs you added through pyenv (which should be expected). Try adding this to your .zshrc
file:
alias brew='env PATH="${PATH//$(pyenv root)\/shims:/}" brew'
答案2
得分: -2
除非您正在从源代码构建Python,否则这些文件不应该引起任何问题:它们可能会使./configure
脚本混淆,正如错误消息所告诉您的那样。
如果您确实想要删除它们,可以使用rm
命令执行如下操作:
rm /Users/sensei/.pyenv/shims/python3.7-config
rm /Users/sensei/.pyenv/shims/python3.7m-config
rm /Users/sensei/.pyenv/shims/python-config
rm /Users/sensei/.pyenv/shims/python3-config
rm /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7-config
rm /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7m-config
rm /Library/Frameworks/Python.framework/Versions/3.7/bin/python3-config
英文:
Unless you’re building Python from source these files shouldn’t cause you any issue: they may confuse ./configure
scripts as the error message tells you, but that’s all.
If you do want to remove them, you can use rm
to do so:
rm /Users/sensei/.pyenv/shims/python3.7-config
rm /Users/sensei/.pyenv/shims/python3.7m-config
rm /Users/sensei/.pyenv/shims/python-config
rm /Users/sensei/.pyenv/shims/python3-config
rm /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7-config
rm /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7m-config
rm /Library/Frameworks/Python.framework/Versions/3.7/bin/python3-config
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论