Difficulty accessing virtual environment - Error: Command returned non-zero exit status 1

Hey Folks,

I am trying to access virutual environment (named hass) but having difficulty. This is the error I get… any help?

pi@raspberrypi:~ $ sudo su -s /bin/bash hass
hass@raspberrypi:/home/pi$ cd /srv/hass
hass@raspberrypi:/srv/hass$ python3 -m venv .
Error: Command '['/srv/hass/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1

I think you need to activate the VENV after you switch users:

source /srv/hass/hass_venv/bin/activate

1 Like