conda'edource deactivate'产生错误:参数太多

时间:2014-04-11 02:56:52

标签: python environment anaconda conda

我正试图在OS X上通过conda create测试创建虚拟环境。这是我第一次真正涉足虚拟环境,因此我仍然围绕着如何使用它们。我的第一次测试是

$ conda create -p /users/me/anaconda/envs/envtest
$ source activate /users/me/anaconda/envs/envtest

但是当我通过source deactivate取下它时,我得到了:

Error: too many arguments.

某些googling似乎表明我的.profile文件中有一些配置会影响此但该文件为空。它可能有助于展示我的.bash_profile

[[ -s "$HOME/.rvm/scripts/rvm" ]] && . "$HOME/.rvm/scripts/rvm" # Load RVM function

# Added by Canopy installer on 2013-09-12
# VIRTUAL_ENV_DISABLE_PROMPT can be set to '' to make bashprompt show that Canopy is active, otherwise 1
VIRTUAL_ENV_DISABLE_PROMPT=1 source /Users/ibebian/Library/Enthought/Canopy_64bit/User/bin/activate

PYTHONPATH="/Library/Python/2.7/site-packages/:$PYTHONPATH"
export PYTHONPATH


set PATH = "$PATH:/Users/ibebian/Desktop/Postgres.app/Contents/MacOS/bin"

# added by Anaconda 1.8.0 installer
export PATH="/Users/ibebian/anaconda/bin:$PATH"

这里有什么见解?非常感谢!

1 个答案:

答案 0 :(得分:3)

是的,问题是set PATH = "$PATH:/Users/ibebian/Desktop/Postgres.app/Contents/MacOS/bin"行。 set设置bash函数的默认参数($1$2等)。因此deactivate认为它被称为deactivate PATH = "$PATH:/Users/ibebian/Desktop/Postgres.app/Contents/MacOS/bin",而不仅仅是deactivate

要分配给变量,只需使用

PATH="$PATH:/Users/ibebian/Desktop/Postgres.app/Contents/MacOS/bin"

(注意这里没有空格)