Saturday, October 23, 2021

[SOLVED] virtualenvwrapper.sh doesn't not run

Issue

I just tried to install virtualenvwrapper and when I run the following (as found in the instructions)

source /usr/local/bin/virtualenvwrapper.sh

It failed with the following :

-bash: /usr/local/bin/virtualenvwrapper.sh: line 347: syntax error near unexpected token `('
-bash: /usr/local/bin/virtualenvwrapper.sh: line 347: `workon () {'

Anybody else is experimenting this?


Solution

You may clean up your Bash shell environment a bit before sourcing /usr/local/bin/virtualenvwrapper.sh.

unalias -a
unset -f $(compgen -A function)
source /usr/local/bin/virtualenvwrapper.sh


Answered By - tim