Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Macos 提示brew doctor时的现有配置脚本_Macos_Configuration_Path_Homebrew - Fatal编程技术网

Macos 提示brew doctor时的现有配置脚本

Macos 提示brew doctor时的现有配置脚本,macos,configuration,path,homebrew,Macos,Configuration,Path,Homebrew,我对自制和Anaconda安装完全陌生,我希望有人能在执行brew doctor后帮我解决警告问题。我正在运行雪豹10.6.8。警告如下: Warning: "config" scripts exist outside your system or Homebrew directories. `./configure` scripts often look for *-config scripts to determine if software packages are installed,

我对自制和Anaconda安装完全陌生,我希望有人能在执行brew doctor后帮我解决警告问题。我正在运行雪豹10.6.8。警告如下:

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 what 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/user.name/anaconda/bin/freetype-config
    /Users/user.name/anaconda/bin/libpng-config
    /Users/user.name/anaconda/bin/libpng15-config
    /Users/user.name/anaconda/bin/llvm-config
    /Users/user.name/anaconda/bin/python-config
    /Users/user.name/anaconda/bin/python2-config
    /Users/user.name/anaconda/bin/python2.7-config
    /Users/user.name/anaconda/bin/xml2-config
    /Users/user.name/anaconda/bin/xslt-config
我执行了brew--config,下面显示了配置(希望对解决此问题有所帮助):


非常感谢你的帮助。谢谢。

tl;dr:您无法真正修复此问题,但您可能可以忽略它

那些以-config结尾的脚本提供了在安装过程中要链接到它们的其他包的信息。让我们以
libpng
为例。如果brew(或任何真正的东西)编译一个依赖于
libpng
的包,它可能会执行
libpng config
,以了解库的一些详细信息

问题是brew自带了自己版本的
libpng
,因此如果同时安装了这两个版本,brew在安装其他软件时可能会选择错误的
libpng config

您现在可以执行以下四项操作之一:

  • 如果您确信使用自制软件安装的内容不会与anaconda附带的内容发生冲突,请忽略此警告

  • 编辑您的
    ~/.bash\u档案
    并从路径中删除蟒蛇。如果执行此操作,则每次要运行anaconda python时都必须指定完整路径

  • 将那些anaconda配置文件移到一边(离开您的路径,例如进入
    config
    子目录)。这可能会阻止其他软件链接到anaconda组件,但如果您打算隔离anaconda,则应该可以

  • 完全删除anaconda(只需删除文件夹)并安装brew版本的python。这还将为您提供pip,这将使您能够轻松地重新安装anaconda附带的大多数其他软件包

    i、 e

    然后要安装,例如numpy,只需:

    pip install numpy
    
    (要使brew的python成为您的默认设置,请将导出路径=“/usr/local/bin:$PATH”添加到您的
    ~/.bash\u配置文件中


  • 我相信我已经找到了一个合理安全的方法来处理这个问题(如果你用的是鱼壳的话)

  • 安装Anaconda,但不添加到路径
  • 在路径上的某个位置向conda二进制文件添加符号链接(在我的例子中~/bin)
  • mkdir~/bin
  • cd~/bin;ln-s~/anaconda3/bin/conda
  • 将如下部分添加到~/.config/fish

    set -gx PATH $PATH ~/bin
    source ~/anaconda3/etc/fish/conf.d/conda.fish
    
    请注意,这是鱼的conda外壳配置——使用
    conda activate some env
    切换到蟒蛇环境,而不是bash样式的
    source activate some env
    <代码>brew doctor应显示此问题不再存在

    此设置允许您使用conda命令切换到conda管理的环境,而无需担心自制管理的python/依赖关系环境之间的泄漏交互

    需要记住的一件事是,当conda环境处于活动状态时,避免运行homebrew,因为您的路径将设置为conda环境,并且对于homebrew的使用不安全。

    可能的解决方案-
    pip install numpy
    
    set -gx PATH $PATH ~/bin
    source ~/anaconda3/etc/fish/conf.d/conda.fish