I am running a bash script that activates a virtualenvironment workon myenv on the raspberry pi and then runs a python script.
Unfortunately, the virtual environment cannot be activated, I get the error workon: command not found
I came across the answer here: https://stackoverflow.com/questions/34611394/virtualenv-workon-command-not-found/34611480
and added following lines to my ~/.profile (and also to ~/.bashrc) file:
export WORKON_HOME=~/.virtualenvs
VIRTUALENVWRAPPER_PYTHON='/usr/bin/python3'
source /usr/local/bin/virtualenvwrapper.sh
Then I've rebooted my raspberry pi but it only works if I add a line source ~/.profile in my bash script. So, it seems like the .profile is not loaded when a bash script is executed.
I am logging into my rpi via ssh.
Any clue what else I could try out?
.profileinto.bash_profile(that one runs whenever a shell is started). – Dougie Nov 25 '22 at 14:52