bash_profile打开cv和fi错误

时间:2017-01-02 08:01:23

标签: bash python-2.7 opencv3.0 .bash-profile

需要解决的问题很少。 首先是一个错误。 -bash:/Users/jay/.bash_profile:第7行:`fi'

第二,我无法更新.bash_profile来安装opencv。 http://www.pyimagesearch.com/2015/06/15/install-opencv-3-0-and-python-2-7-on-osx/

以下是以下代码,请帮忙。

非常感谢!

# added by Anaconda2 4.2.0 installer
export PATH="/Users/jay/anaconda2/bin:$PATH"
export PATH=/usr/local/bin:$PATH

  source '/Users/jay/Downloads/google-cloud-sdk/path.bash.inc'
fi
  source '/Users/jay/Downloads/google-cloud-sdk/completion.bash.inc'
fi

# The next line updates PATH for the Google Cloud SDK.
if [ -f /Users/jay/Downloads/google-cloud-sdk/path.bash.inc ]; then
  source '/Users/jay/Downloads/google-cloud-sdk/path.bash.inc'
fi

# The next line enables shell command completion for gcloud.
if [ -f /Users/jay/Downloads/google-cloud-sdk/completion.bash.inc ]; then
  source '/Users/jay/Downloads/google-cloud-sdk/completion.bash.inc'

1 个答案:

答案 0 :(得分:0)

您的fi语句没有iffi是'开放'if的'结束'语句:

  source '/Users/jay/Downloads/google-cloud-sdk/path.bash.inc'
fi
  source '/Users/jay/Downloads/google-cloud-sdk/completion.bash.inc'
fi
例如,

bash syntax for if statements

if [ -f /var/log/messages ]; then
    echo "/var/log/messages exists."
fi

所以对你来说这可能是:

if [ -f '/Users/jay/Downloads/google-cloud-sdk/path.bash.inc'];  then
    source '/Users/jay/Downloads/google-cloud-sdk/path.bash.inc'
fi

和下一行类似。

并且文件末尾缺少最终fi