Solved:Why can't call hass?

sudo useradd -rm homeassistant
sudo mkdir /srv/homeassistant
sudo chown homeassistant:homeassistant /srv/homeassistant
sudo -u homeassistant -H -s
cd /srv/homeassistant
python3.11 -m venv .
source bin/activate
pip3.11 install wheel --target=/srv/homeassistant
pip3.11 install homeassistant==2023.7.3  --target=/srv/homeassistant

I install homeassistant this way.

(homeassistant) homeassistant@debian:/srv/homeassistant$ hass
Traceback (most recent call last):
  File "/srv/homeassistant/bin/hass", line 5, in <module>
    from homeassistant.__main__ import main
ModuleNotFoundError: No module named 'homeassistant'

Why No module named ‘homeassistant’ ?

did you try without the “target”-parameter for pip?
Just wondering why you use this parameter, this is not in the documentation and, per my understanding, might not install into the ./lib/python3.11/site-packages folder.

1 Like

If my answer helped to fix your problem, please mark it as solution, this might help others having a similar issue