在docker中安装 虚拟环境时执行
source /usr/local/bin/virtualenvwrapper.sh
报错:
/usr/local/bin/virtualenvwrapper.sh: line 230:: command not found
virtualenvwrapper.sh: There was a problem running the initialization hooks.
If Python could notimport the module virtualenvwrapper.hook_loader,
check that virtualenvwrapper has been installed for
VIRTUALENVWRAPPER_PYTHON=and that PATH isset properly.
原因 : 因为在virtualenvwrapper.sh中有如下代码
# Locate the global Python where virtualenvwrapper is installed.if["$VIRTUALENVWRAPPER_PYTHON"=""] then
VIRTUALENVWRAPPER_PYTHON="$(command \which python)"# 脚本会默认使用python2环境,但是virtualenvwrapper装在了python3环境中,所以会有上面的报错