简体   繁体   中英

bash_profile open cv and fi error

There are few problems that need to solve. first there is an error. -bash: /Users/jay/.bash_profile: line 7: `fi'

second, i am having trouble updating .bash_profile to install opencv. http://www.pyimagesearch.com/2015/06/15/install-opencv-3-0-and-python-2-7-on-osx/

Here are the code below and please help.

many thanks!

# 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'

you have fi statements without if ( fi is the 'closing' statement for an 'opening' 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 is eg

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

so for you this may be:

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

and similar for the next line.

and there is a final fi missing at the end of your file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM