Different command behaviour between SERIAL and SSH

I am trying to establish a python virtual environment with Linux board (NanoPi Duo2 with Ubuntu 16).

However, when I use SSH, wrapper functions (mkvirtualenv, workon) cannot be found while using SERIAL, it can.

I have tried system reboot and "source ~/.profile"

The below is ~/.profile

# virtualenv and virtualenvwrapper
export WORKON_HOME=$HOME/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh

The following is the actual output from same board connected differently.

pi@$ mkvirtualenv npi
bash: mkvirtualenv: command not found
pi@NPi-01:~$ mkvirtualenv npi
New python executable in /home/pi/.virtualenvs/npi/bin/python
Installing setuptools, pip, wheel...

Why would it only work in serial connection?