Stuck in installation of core on a raspbery pi4

Hi,

I´m new to homeassistant and trying to install this on a Raspberry PI with the core method.

I worked through the steps and get stuck when I have to install HA :slight_smile:

(homeassistant) homeassistant@ha:/srv/homeassistant $ pip install homeassistant==2023.11.2
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.

If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.

For more information visit http://rptl.io/venv

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

Maybe anybody has a hint, thx in advance

JL

My first suggestion would be to use Docker (HA Container).

However, if you want to continue with this, make sure the venv is active and configured according to the docs.

Hi there!

I have the exact same problem with my Pi4.
I would prefer not to use Docker. Does anybody know a workaround as the doc is broken?

I tried to force the installation by adding --break-system-packages. It does things… it installs Home Assistant. The installer says to update the PATH environment variable, and I did. But when launching hass it doesn’t work and I received this error message:

homeassistant@raspberrypi:/home/arnaud $ hass
Unable to find configuration. Creating default one in /home/homeassistant/.homeassistant
2023-12-22 19:35:14.232 ERROR (SyncWorker_2) [homeassistant.util.package] Unable to install package pyotp==2.8.0: error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
python3-xyz, where xyz is the package you are trying to
install.

If you wish to install a non-Debian-packaged Python package,
create a virtual environment using python3 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
sure you have python3-full installed.

For more information visit http://rptl.io/venv

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

The error in the OP is from not having the venv active. I just did a test install on a Bookworm host, and with the venv activated you don’t get that error. However without the venv activated you do get that error.

Hi @Tinkerer,

Thanks for your assistance. I found the issue!

It was because the copy and paste from the documentation website seems to not work properly. In fact I wasn’t in the /srv/homeassistant directory when trying to create the venv.

I am having the same issue although I followed the steps in the doc.
@Tinkerer could you please explain how to check if venv is activated?

Below is what I did, in case I missed a step.

pi@haigwepa ~ $ sudo -u homeassistant -H -s
homeassistant@haigwepa:/home/pi$ cd /srv/homeassistant
homeassistant@haigwepa:/srv/homeassistant$ python3 -m venv .
homeassistant@haigwepa:/srv/homeassistant$ source bin/activate
(homeassistant) homeassistant@haigwepa:/srv/homeassistant$ python3 -m pip install wheel
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: wheel in ./lib/python3.11/site-packages (0.45.1)
(homeassistant) homeassistant@haigwepa:/srv/homeassistant$ pip3 install homeassistant==2025.1.1
error: externally-managed-environment

× This environment is externally managed
╰─> To install Python packages system-wide, try apt install
    python3-xyz, where xyz is the package you are trying to
    install.

    If you wish to install a non-Debian-packaged Python package,
    create a virtual environment using python3 -m venv path/to/venv.
    Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make
    sure you have python3-full installed.

    If you wish to install a non-Debian packaged Python application,
    it may be easiest to use pipx install xyz, which will manage a
    virtual environment for you. Make sure you have pipx installed.

    See /usr/share/doc/python3.11/README.venv for more information.

note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.

That’s what you did there

No idea why you’re getting that error. When you get that, immediately type which pip3 and see what you get back. I wonder if that’s calling the system pip3 and you need to just use pip install ...

Not sure what happened but trying again tonight I got:

ERROR: No matching distribution found for homeassistant==2025.1.1

Then I tried

pip3 install homeassistant

Which installed homeassistant-2024.3.3-py3-none-any.whl

And I can now run Home Assistant fine

That means you have an older version of Python, and won’t get any HA updates until you fix that.

You’ll probably find that you’ve got Python 3.11. Python 3.12 is currently required, and that’ll change to 3.13 soon, and 3.14 around the same time next year (probably), etc.

Either install Python 3.13 using pyenv or switch to Docker.