4

我正在尝试conda create在 OS X 上测试创建虚拟环境。这是我第一次真正涉足虚拟环境,所以我仍在思考如何使用它们。我的第一个测试是

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

但是当我通过 删除它时source deactivate,我得到:

Error: too many arguments.

一些谷歌搜索似乎表明我的 .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"

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

4

1 回答 1

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"

(注意这里没有空格)

于 2014-04-11T15:16:39.027 回答