Command '' not found + virtualenvwrapper error on ssh login (Ubuntu 18.04 x64)

In lines 47-51 of the virtualenvwrapper.sh script, it first checks to see if the environment variable VIRTUALENVWRAPPER_PYTHON is set, and if not, it sets it in line 50:

VIRTUALENVWRAPPER_PYTHON="$(command \which python)"

The problem is that newer versions of Ubuntu (18.04+) no longer come with the binary python installed, only python3. Change python to python3 in line 50 of the script and you're all set ;)

Otherwise, in .bashrc, you need to first set VIRTUALENVWRAPPER_PYTHON and then source the script:

VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
source /usr/local/bin/virtualenvwrapper.sh

In short, virtualenvwrapper.sh is part of a Python package.

I ran into this on a new Ubuntu 18.04 installation. I checked my logs on an older machine and found the following:

sudo -H pip3 install virtualenvwrapper
sudo -H pip  install virtualenvwrapper

When I ran them on the new machine, the error message went away.