It can happen that you run into trouble while installing Home Assistant. This page is here to help you solve the most common problems.
pip3: command not found
This utility should have been installed as part of the Python installation. Check if Python is installed by running python3 --version
. If it is not installed, download it here.
If you are able to successfully run python3 --version
but not pip3
, install Home Assistant by running the following command instead:
python3 -m pip install homeassistant
On a Debian system, you can also install python3 by sudo apt-get install python3
, and pip3 by sudo apt-get install python3-pip
.
No module named pip
Pip should come bundled with the latest Python 3 but is omitted by some distributions. If you are unable to run python3 -m pip --version
you can install pip
by downloading the installer and running it with Python 3:
No access to the frontend
In newer Linux distributions the access to a host is very limited. This means that you can’t access the Home Assistant frontend that is running on a host outside of the host machine.
To fix this you will need to open your machine’s firewall for TCP traffic to port 8123. The method for doing this will vary depending on your operating system and the firewall you have installed. Below are some suggestions to try. Google is your friend here.
For UFW systems (Ubuntu, Debian, Raspberry Pi OS, etc.):
For iptables
systems (was the default for older distributions):
iptables -I INPUT -p tcp --dport 8123 -j ACCEPT
iptables-save > /etc/network/iptables.rules # your rules may be saved elsewhere
System freezes
On small systems (such as a Pi2), not directly supported by binaries (Python Wheels) you may run out of memory.
Upon the first run or after an upgrade, Home Assistant uses a lot of resources to (re)compile all the integrations.
If you run out of memory and/or swap memory, your system will freeze.
Increasing swap memory can help:
sudo dphys-swapfile swapoff
sudo nano /etc/dphys-swapfile
Modify the line the sets the swapfile size. Set it equal to your memory or double your current setting: CONF_SWAPSIZE = 925
then:
sudo dphys-swapfile swapon
sudo systemctl restart dphys-swapfile.service
Help us to improve our documentation
Suggest an edit to this page, or provide/view feedback for this page.
Hello , I can’t install HASS ,after entering the command «pip install home assistant».I get the following error: subprocess-exited-with-error
~ $ # create a virtual environment (optional, but recommended)
python -m venv hass
source hass/bin/activate
pip install homeassistant
Collecting homeassistant
Using cached homeassistant-2022.9.2-py3-none-any.whl (19.3 MB)
Collecting astral==2.2
Using cached astral-2.2-py2.py3-none-any.whl (30 kB)
Collecting certifi>=2021.5.30
Using cached certifi-2022.6.15.1-py3-none-any.whl (160 kB)
Collecting requests==2.28.1
Using cached requests-2.28.1-py3-none-any.whl (62 kB)
Collecting voluptuous-serialize==2.5.0
Using cached voluptuous_serialize-2.5.0-py3-none-any.whl (6.8 kB)
Collecting ciso8601==2.2.0
Using cached ciso8601-2.2.0.tar.gz (18 kB)
Installing build dependencies … done
Getting requirements to build wheel … done
Preparing metadata (pyproject.toml) … done
Collecting jinja2==3.1.2
Using cached Jinja2-3.1.2-py3-none-any.whl (133 kB)
Requirement already satisfied: pip<22.3,>=21.0 in ./hass/lib/python3.10/site-packages (from homeassistant) (22.2.2)
Collecting ifaddr==0.1.7
Using cached ifaddr-0.1.7-py2.py3-none-any.whl (10 kB)
Collecting voluptuous==0.13.1
Using cached voluptuous-0.13.1-py3-none-any.whl (29 kB)
Collecting async-timeout==4.0.2
Using cached async_timeout-4.0.2-py3-none-any.whl (5.8 kB)
Collecting lru-dict==1.1.8
Using cached lru-dict-1.1.8.tar.gz (10 kB)
Preparing metadata (setup.py) … done
Collecting attrs==21.2.0
Using cached attrs-21.2.0-py2.py3-none-any.whl (53 kB)
Collecting yarl==1.7.2
Using cached yarl-1.7.2.tar.gz (168 kB)
Installing build dependencies … done
Getting requirements to build wheel … done
Preparing metadata (pyproject.toml) … done
Collecting bcrypt==3.1.7
Using cached bcrypt-3.1.7.tar.gz (42 kB)
Installing build dependencies … done
Getting requirements to build wheel … done
Preparing metadata (pyproject.toml) … done
Collecting PyJWT==2.4.0
Using cached PyJWT-2.4.0-py3-none-any.whl (18 kB)
Collecting awesomeversion==22.8.0
Using cached awesomeversion-22.8.0-py3-none-any.whl (11 kB)
Collecting httpx==0.23.0
Using cached httpx-0.23.0-py3-none-any.whl (84 kB)
Collecting atomicwrites-homeassistant==1.4.1
Using cached atomicwrites_homeassistant-1.4.1-py2.py3-none-any.whl (7.1 kB)
Collecting pyyaml==6.0
Using cached PyYAML-6.0.tar.gz (124 kB)
Installing build dependencies … done
Getting requirements to build wheel … done
Preparing metadata (pyproject.toml) … done
Collecting typing-extensions<5.0,>=3.10.0.2
Using cached typing_extensions-4.3.0-py3-none-any.whl (25 kB)
Collecting cryptography==37.0.4
Using cached cryptography-37.0.4.tar.gz (585 kB)
Installing build dependencies … done
Getting requirements to build wheel … done
Preparing metadata (pyproject.toml) … done
Collecting python-slugify==4.0.1
Using cached python-slugify-4.0.1.tar.gz (11 kB)
Preparing metadata (setup.py) … done
Collecting orjson==3.7.11
Using cached orjson-3.7.11.tar.gz (946 kB)
Installing build dependencies … error
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> [58 lines of output]
Collecting maturin<0.14,>=0.13
Using cached maturin-0.13.2.tar.gz (146 kB)
Installing build dependencies: started
Installing build dependencies: finished with status ‘done’
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status ‘done’
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status ‘done’
Collecting tomli>=1.1.0
Using cached tomli-2.0.1-py3-none-any.whl (12 kB)
Building wheels for collected packages: maturin
Building wheel for maturin (pyproject.toml): started
Building wheel for maturin (pyproject.toml): finished with status ‘error’
error: subprocess-exited-with-error
× Building wheel for maturin (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [34 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-armv7l-cpython-310
creating build/lib.linux-armv7l-cpython-310/maturin
copying maturin/__init__.py -> build/lib.linux-armv7l-cpython-310/maturin
copying maturin/__main__.py -> build/lib.linux-armv7l-cpython-310/maturin
copying maturin/import_hook.py -> build/lib.linux-armv7l-cpython-310/maturin
running egg_info
creating maturin.egg-info
writing maturin.egg-info/PKG-INFO
writing dependency_links to maturin.egg-info/dependency_links.txt
writing requirements to maturin.egg-info/requires.txt
writing top-level names to maturin.egg-info/top_level.txt
writing manifest file 'maturin.egg-info/SOURCES.txt'
reading manifest file 'maturin.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'maturin.egg-info/SOURCES.txt'
running build_ext
running build_rust
error: rustup could not choose a version of rustc to run, because one wasn't specified explicitly, and no default is configured.
help: run 'rustup default stable' to download the latest stable release of Rust and set it as your default toolchain.
error: can't find Rust compiler
If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.
To update pip, run:
pip install --upgrade pip
and then retry package installation.
If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for maturin
Failed to build maturin
ERROR: Could not build wheels for maturin, which is required to install pyproject.toml-based projects
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
(hass) ~ $
Hello , I can’t install HASS ,after entering the command «pip install home assistant».I get the following error: subprocess-exited-with-error
~ $ # create a virtual environment (optional, but recommended)
python -m venv hass
source hass/bin/activate
pip install homeassistant
Collecting homeassistant
Using cached homeassistant-2022.9.2-py3-none-any.whl (19.3 MB)
Collecting astral==2.2
Using cached astral-2.2-py2.py3-none-any.whl (30 kB)
Collecting certifi>=2021.5.30
Using cached certifi-2022.6.15.1-py3-none-any.whl (160 kB)
Collecting requests==2.28.1
Using cached requests-2.28.1-py3-none-any.whl (62 kB)
Collecting voluptuous-serialize==2.5.0
Using cached voluptuous_serialize-2.5.0-py3-none-any.whl (6.8 kB)
Collecting ciso8601==2.2.0
Using cached ciso8601-2.2.0.tar.gz (18 kB)
Installing build dependencies … done
Getting requirements to build wheel … done
Preparing metadata (pyproject.toml) … done
Collecting jinja2==3.1.2
Using cached Jinja2-3.1.2-py3-none-any.whl (133 kB)
Requirement already satisfied: pip<22.3,>=21.0 in ./hass/lib/python3.10/site-packages (from homeassistant) (22.2.2)
Collecting ifaddr==0.1.7
Using cached ifaddr-0.1.7-py2.py3-none-any.whl (10 kB)
Collecting voluptuous==0.13.1
Using cached voluptuous-0.13.1-py3-none-any.whl (29 kB)
Collecting async-timeout==4.0.2
Using cached async_timeout-4.0.2-py3-none-any.whl (5.8 kB)
Collecting lru-dict==1.1.8
Using cached lru-dict-1.1.8.tar.gz (10 kB)
Preparing metadata (setup.py) … done
Collecting attrs==21.2.0
Using cached attrs-21.2.0-py2.py3-none-any.whl (53 kB)
Collecting yarl==1.7.2
Using cached yarl-1.7.2.tar.gz (168 kB)
Installing build dependencies … done
Getting requirements to build wheel … done
Preparing metadata (pyproject.toml) … done
Collecting bcrypt==3.1.7
Using cached bcrypt-3.1.7.tar.gz (42 kB)
Installing build dependencies … done
Getting requirements to build wheel … done
Preparing metadata (pyproject.toml) … done
Collecting PyJWT==2.4.0
Using cached PyJWT-2.4.0-py3-none-any.whl (18 kB)
Collecting awesomeversion==22.8.0
Using cached awesomeversion-22.8.0-py3-none-any.whl (11 kB)
Collecting httpx==0.23.0
Using cached httpx-0.23.0-py3-none-any.whl (84 kB)
Collecting atomicwrites-homeassistant==1.4.1
Using cached atomicwrites_homeassistant-1.4.1-py2.py3-none-any.whl (7.1 kB)
Collecting pyyaml==6.0
Using cached PyYAML-6.0.tar.gz (124 kB)
Installing build dependencies … done
Getting requirements to build wheel … done
Preparing metadata (pyproject.toml) … done
Collecting typing-extensions<5.0,>=3.10.0.2
Using cached typing_extensions-4.3.0-py3-none-any.whl (25 kB)
Collecting cryptography==37.0.4
Using cached cryptography-37.0.4.tar.gz (585 kB)
Installing build dependencies … done
Getting requirements to build wheel … done
Preparing metadata (pyproject.toml) … done
Collecting python-slugify==4.0.1
Using cached python-slugify-4.0.1.tar.gz (11 kB)
Preparing metadata (setup.py) … done
Collecting orjson==3.7.11
Using cached orjson-3.7.11.tar.gz (946 kB)
Installing build dependencies … error
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> [58 lines of output]
Collecting maturin<0.14,>=0.13
Using cached maturin-0.13.2.tar.gz (146 kB)
Installing build dependencies: started
Installing build dependencies: finished with status ‘done’
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status ‘done’
Preparing metadata (pyproject.toml): started
Preparing metadata (pyproject.toml): finished with status ‘done’
Collecting tomli>=1.1.0
Using cached tomli-2.0.1-py3-none-any.whl (12 kB)
Building wheels for collected packages: maturin
Building wheel for maturin (pyproject.toml): started
Building wheel for maturin (pyproject.toml): finished with status ‘error’
error: subprocess-exited-with-error
× Building wheel for maturin (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [34 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-armv7l-cpython-310
creating build/lib.linux-armv7l-cpython-310/maturin
copying maturin/__init__.py -> build/lib.linux-armv7l-cpython-310/maturin
copying maturin/__main__.py -> build/lib.linux-armv7l-cpython-310/maturin
copying maturin/import_hook.py -> build/lib.linux-armv7l-cpython-310/maturin
running egg_info
creating maturin.egg-info
writing maturin.egg-info/PKG-INFO
writing dependency_links to maturin.egg-info/dependency_links.txt
writing requirements to maturin.egg-info/requires.txt
writing top-level names to maturin.egg-info/top_level.txt
writing manifest file 'maturin.egg-info/SOURCES.txt'
reading manifest file 'maturin.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'maturin.egg-info/SOURCES.txt'
running build_ext
running build_rust
error: rustup could not choose a version of rustc to run, because one wasn't specified explicitly, and no default is configured.
help: run 'rustup default stable' to download the latest stable release of Rust and set it as your default toolchain.
error: can't find Rust compiler
If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.
To update pip, run:
pip install --upgrade pip
and then retry package installation.
If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for maturin
Failed to build maturin
ERROR: Could not build wheels for maturin, which is required to install pyproject.toml-based projects
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
(hass) ~ $
Hi all!
As you can see from the title, this is my issue. I have a clean install of Win10. I have also installed visual studio and build tools. Can anyone assist? This the the install log. Thanks in advance.
C:UsersMarc>py -m pip install homeassistant
Collecting homeassistant
Using cached homeassistant-0.118.4-py3-none-any.whl (9.9 MB)
Collecting bcrypt==3.1.7
Using cached bcrypt-3.1.7.tar.gz (42 kB)
Installing build dependencies … done
Getting requirements to build wheel … done
Preparing wheel metadata … done
Collecting pyyaml==5.3.1
Using cached PyYAML-5.3.1-cp39-cp39-win_amd64.whl (212 kB)
Collecting python-slugify==4.0.1
Using cached python-slugify-4.0.1.tar.gz (11 kB)
Requirement already satisfied: pip>=8.0.3 in c:usersmarcappdatalocalprogramspythonpython39libsite-packages (from homeassistant) (20.2.4)
Collecting ciso8601==2.1.3
Using cached ciso8601-2.1.3.tar.gz (15 kB)
Collecting jinja2>=2.11.2
Using cached Jinja2-2.11.2-py2.py3-none-any.whl (125 kB)
Collecting ruamel.yaml==0.15.100
Using cached ruamel.yaml-0.15.100.tar.gz (318 kB)
Collecting astral==1.10.1
Using cached astral-1.10.1-py2.py3-none-any.whl (29 kB)
Collecting httpx==0.16.1
Using cached httpx-0.16.1-py3-none-any.whl (65 kB)
Collecting pytz>=2020.1
Using cached pytz-2020.4-py2.py3-none-any.whl (509 kB)
Collecting cryptography==3.2
Using cached cryptography-3.2-cp36-abi3-win_amd64.whl (1.5 MB)
Collecting voluptuous-serialize==2.4.0
Using cached voluptuous_serialize-2.4.0-py3-none-any.whl (6.7 kB)
Collecting PyJWT==1.7.1
Using cached PyJWT-1.7.1-py2.py3-none-any.whl (18 kB)
Collecting async-timeout==3.0.1
Using cached async_timeout-3.0.1-py3-none-any.whl (8.2 kB)
Collecting yarl==1.4.2
Using cached yarl-1.4.2.tar.gz (163 kB)
Collecting certifi>=2020.6.20
Using cached certifi-2020.11.8-py2.py3-none-any.whl (155 kB)
Collecting aiohttp==3.7.1
Using cached aiohttp-3.7.1-cp39-cp39-win_amd64.whl (632 kB)
Collecting attrs==19.3.0
Using cached attrs-19.3.0-py2.py3-none-any.whl (39 kB)
Collecting voluptuous==0.12.0
Using cached voluptuous-0.12.0-py3-none-any.whl (29 kB)
Collecting requests==2.25.0
Using cached requests-2.25.0-py2.py3-none-any.whl (61 kB)
Requirement already satisfied: cffi>=1.1 in c:usersmarcappdatalocalprogramspythonpython39libsite-packages (from bcrypt==3.1.7->homeassistant) (1.14.4)
Requirement already satisfied: six>=1.4.1 in c:usersmarcappdatalocalprogramspythonpython39libsite-packages (from bcrypt==3.1.7->homeassistant) (1.15.0)
Collecting text-unidecode>=1.3
Using cached text_unidecode-1.3-py2.py3-none-any.whl (78 kB)
Collecting MarkupSafe>=0.23
Using cached MarkupSafe-1.1.1.tar.gz (19 kB)
Collecting httpcore==0.12.*
Using cached httpcore-0.12.2-py3-none-any.whl (54 kB)
Collecting sniffio
Using cached sniffio-1.2.0-py3-none-any.whl (10 kB)
Collecting rfc3986[idna2008]<2,>=1.3
Using cached rfc3986-1.4.0-py2.py3-none-any.whl (31 kB)
Collecting multidict>=4.0
Using cached multidict-5.0.2-cp39-cp39-win_amd64.whl (48 kB)
Collecting idna>=2.0
Using cached idna-2.10-py2.py3-none-any.whl (58 kB)
Collecting chardet<4.0,>=2.0
Using cached chardet-3.0.4-py2.py3-none-any.whl (133 kB)
Collecting typing-extensions>=3.6.5
Using cached typing_extensions-3.7.4.3-py3-none-any.whl (22 kB)
Collecting urllib3<1.27,>=1.21.1
Using cached urllib3-1.26.2-py2.py3-none-any.whl (136 kB)
Requirement already satisfied: pycparser in c:usersmarcappdatalocalprogramspythonpython39libsite-packages (from cffi>=1.1->bcrypt==3.1.7->homeassistant) (2.20)
Collecting h11==0.*
Using cached h11-0.11.0-py2.py3-none-any.whl (54 kB)
Using legacy ‘setup.py install’ for python-slugify, since package ‘wheel’ is not installed.
Using legacy ‘setup.py install’ for ciso8601, since package ‘wheel’ is not installed.
Using legacy ‘setup.py install’ for ruamel.yaml, since package ‘wheel’ is not installed.
Using legacy ‘setup.py install’ for yarl, since package ‘wheel’ is not installed.
Using legacy ‘setup.py install’ for MarkupSafe, since package ‘wheel’ is not installed.
Building wheels for collected packages: bcrypt
Building wheel for bcrypt (PEP 517) … error
ERROR: Command errored out with exit status 1:
command: ‘C:UsersMarcAppDataLocalProgramsPythonPython39python.exe’ ‘C:UsersMarcAppDataLocalProgramsPythonPython39libsite-packagespip_vendorpep517_in_process.py’ build_wheel ‘C:UsersMarcAppDataLocalTemptmp5l29l6vo’
cwd: C:UsersMarcAppDataLocalTemppip-install-7gbc8cgpbcrypt
Complete output (14 lines):
running bdist_wheel
running build
running build_py
creating build
creating buildlib.win-amd64-3.9
creating buildlib.win-amd64-3.9bcrypt
copying srcbcrypt__about__.py -> buildlib.win-amd64-3.9bcrypt
copying srcbcrypt__init__.py -> buildlib.win-amd64-3.9bcrypt
running build_ext
generating cffi module ‘build\temp.win-amd64-3.9\Release\_bcrypt.c’
creating buildtemp.win-amd64-3.9
creating buildtemp.win-amd64-3.9Release
building ‘_bcrypt’ extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with «Microsoft C++ Build Tools»: https://visualstudio.microsoft.com/visual-cpp-build-tools/
—————————————-
ERROR: Failed building wheel for bcrypt
Failed to build bcrypt
ERROR: Could not build wheels for bcrypt which use PEP 517 and cannot be installed directly
Loading
Update: новая статья
У новых пользователей часто возникает вопрос — можно ли установить Home Assistant на Windows?
Конечно можно! Проблема заключается в том, что не все зависимости Home Assistant легко установятся на любую сборку Windows. Об этом можно почитать тут.
На портале уже была статья о подобной установке. В своей версии я чуть подробнее опишу детали.
Идём на сайт python и скачиваем последнюю на момент написания статьи версию. Можно скачать как обычную, так и 64-битную версию.
В процессе установки Python я встречал следующие проблемы:
- установка не стартовала на «голой» Windows 7 без важных обновлений — нужно обновить систему стандартным способом
- установка не завершалась с недоступным сайтом python (из-за РКН) — нужно отключить опции download debug…
Вот у вас и установлен Python.
Далее нажимаем на клавиатуре win R и запускаем cmd
В запустившейся консоли вводим :
pip install homeassistant
Вот у вас и установлен последний Home Assistant.
На этом этапе у вас не должно возникнуть особых проблем. Python и HA должны установиться в практически любую систему.
Первый запуск Home Assistant
В той же консоли, что и ранее, просто вводим — hass.
Начнётся первый запуск HA. Он может быть достаточно долгим. HA будет скачивать и устанавливать разные библиотеки python, которые требуются конфигурации по умолчанию. А их не мало.
Плюс, если в процессе установки в вашей локальной сети обнаружатся поддерживаемые устройства — начнётся установка и их библиотек. В логе это отображается примерно так:
INFO (SyncWorker_1) [homeassistant.util.package] Attempting install of pychromecast==4.0.1
Вот на этом этапе вполне возможны проблемы и разные ошибки в консоли.
Терпеливо ждите пока HA делает свои дела. В идеале в конце лога вы должны увидеть строчку:
INFO (MainThread) [homeassistant.core] Starting Home Assistant
Далее попытайтесь открыть в любом браузере страницу:
http://localhost:8123/Вполне возможно у вас ничего не откроется. Это нормально.
План 2
Нажимайте в консоли Ctrl C, это принудительно остановит HA. Если не получится — закрывайте консоль и запускайте её заново.
И снова вводите в консоли — hass. И снова ждём строчку Starting Home Assistant и пробуем открыть в браузере:
http://localhost:8123/
План 3
Если со второй попытки страница так и не открылась — останавливаем HA и открываем папку с конфигами. Путь до неё показывается сразу после ввода команды hass. Это должно быть что-то вроде:
C:\Users\Alexey\AppData\Roaming\.homeassistant
Только с именем вашего пользователя. Проще вбить этот адрес сразу в проводнике Windows.
Теперь правим файл configuration.yaml.
Заменяем всё его содержимое на 3 простые строки:
config: frontend: system_health:
Это минимальный набор модулей, необходимый для старта HA и отображения главной страницы. Сильно сократит перечень зависимостей и повысит шансы старта.
Снова запускаем hass и пробуем открыть страницу.
PS
Это не все проблемы с которыми можно столкнуться. Но, надеюсь, вам хватит советов, описанных в статье.