简体   繁体   English

适用于virtualenv和Python的OSX 10.11.6版中的〜/ .bash_profile

[英]~/.bash_profile in OSX version 10.11.6 for virtualenv and Python

So when I just write these commands in the terminal I get these errors: 因此,当我只在终端中编写以下命令时,就会出现以下错误:

 /  L/F/P  Versions  export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3                                                                    ➶ 127  04:21:45 PM
 /  L/F/P  Versions  source /usr/local/bin/virtualenvwrapper.sh                                                                                        04:21:52 PM
Expected end of the statement, but instead found a '&'
/usr/local/bin/virtualenvwrapper.sh (line 67): if [ "$OS" = "Windows_NT" ] && ([ "$MSYSTEM" = "MINGW32" ] || [ "$MSYSTEM" = "MINGW64" ])
                                                                            ^
from sourcing file /usr/local/bin/virtualenvwrapper.sh
    called on standard input

source: Error while reading file '/usr/local/bin/virtualenvwrapper.sh'

Also when I write them in ~/.bash_profile I get these errors: 另外,当我在~/.bash_profile编写它们时, ~/.bash_profile出现以下错误:

 /  L/F/P  Versions  vi ~/.bash_profile                                                                                                                04:18:50 PM
 /  L/F/P  Versions  source ~/.bash_profile                                                                                                            04:21:11 PM
Unsupported use of '&&'. In fish, please use 'COMMAND; and COMMAND'.
~/.bash_profile (line 3): [[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile
                                                     ^
from sourcing file ~/.bash_profile
    called on standard input

source: Error while reading file '/Users/mona/.bash_profile'

I have these in my ~/.bash_profile : 我在~/.bash_profile有这些:

 ~/.bash_profile
  1 export PATH=$PATH:/usr/local/go/bin
  2
  3 [[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile
  4
  5 [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
  6
  7 # Setting PATH for Python 3.4
  8 # The orginal version is saved in .bash_profile.pysave
  9 PATH="/Library/Frameworks/Python.framework/Versions/3.4/bin:${PATH}"
 10 export PATH
 11
 12 # added by Anaconda2 2.4.1 installer
 13 export PATH="/Users/mona/anaconda/bin:$PATH"
 14
 15 compresspdf() {
 16       gs -sDEVICE=pdfwrite -dNOPAUSE -dQUIET -dBATCH -dPDFSETTINGS=/${3:-"screen"} -dCompatibilityLevel=1.4 -sOutputFile=$2 $1
 17     }
 18
 19
 20 export PATH="/usr/local/sbin:$PATH"
 21 export PATH=/usr/local/bin:$PATH
 22 export VIRTUALENVWRAPPER_PYTHON=/usr/local/bin/python3
 23 source /usr/local/bin/virtualenvwrapper.sh
~

I am trying to follow this tutorial: 我正在尝试遵循本教程:

http://www.pyimagesearch.com/2015/06/29/install-opencv-3-0-and-python-3-4-on-osx/

Thanks for any help or comment. 感谢您的帮助或评论。

 /  L/F/P  Versions  python                                                                                                                            04:28:32 PM
Python 3.5.2 (default, Jul 28 2016, 21:28:07)
[GCC 4.2.1 Compatible Apple LLVM 7.0.2 (clang-700.1.81)] on darwin
Type "help", "copyright", "credits" or "license" for more information.

It looks like you're using fish shell. 它看起来像你使用fish贝。 Your bash profile is written using items that are apparently unsupported by fish, see specifically 您的bash个人资料是使用明显不受鱼支持的项目编写的,具体请参见

Unsupported use of '&&'. In fish, please use 'COMMAND; and COMMAND'.

From when you tried to source your bash profile. 从您尝试获取bash配置文件开始。 You may need to find a different tutorial to follow, create the virtualenvs yourself, or try to translate the bash pieces of the tutorial to fish. 您可能需要找到其他教程才能继续学习,自己创建virtualenvs或尝试将教程的重磅内容翻译成鱼。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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