我有一个使用virtualenvwrapper来创建virtualenv的结构脚本,但是在运行mkvirutalenv之后,结构脚本会抱怨返回代码,请参阅下面的
[localhost] run: export WORKON_HOME=/srv/www && source /usr/local/bin/virtualenvwrapper.sh && mkvirtualenv james --no-site-packages --distribute
[localhost] Login password for 'james':
[localhost] out: New python executable in james/bin/python
[localhost] out: Installing distribute...........................................................................................................................................................................................................................done.
[localhost] out: Installing pip................done.
Fatal error: run() received nonzero return code 1 while executing!
Requested: export WORKON_HOME=/srv/www && source /usr/local/bin/virtualenvwrapper.sh && mkvirtualenv james --no-site-packages --distribute
Executed: /bin/bash -l -c "cd /srv/www && export WORKON_HOME=/srv/www && source /usr/local/bin/virtualenvwrapper.sh && mkvirtualenv james --no-site-packages --distribute"
Aborting.
答案 0 :(得分:1)
想通了--no-site-packages和--distribute的位置必须在virtualenv名称前面才能返回0,例如
mkvirtualenv --no-site-packages --distribute <name>