I use virtualenvwrapper to manage my Python environments. My global
postactivate file — a Bash script that gets sourced, after a virtual environment is activated — contains the following:
if [ -f 'activate.sh' ]; then echo 'activate virtualenv settings' source 'activate.sh' fi
This should source the
activate.sh file only if the project that is connected to the virtual environment contains such a file. But if I use the
workon command on a project that contains such a file, I get the following output and error:
activate virtualenv settings /home/…/.virtualenvs/postactivate: Zeile 15: source: activate.sh: Datei nicht gefunden.
So, the test seems to find the
activate.sh file but line 15 throws an error (that's the line with
source activate.sh and the error translates to file not found). Why?