home-assistant / home-assistant.io

:blue_book: Home Assistant User documentation
https://www.home-assistant.io
Other
4.76k stars 7.19k forks source link

Difficulty installing Home Assistant on fresh Windows 11 WSL install #29882

Open DanMelbourne opened 10 months ago

DanMelbourne commented 10 months ago

Feedback

I've just followed the instructions for installing HASS Core on Windows 11 WSL with Ubuntu.

This command doesn't work:

sudo apt-get install -y python3 python3-dev python3-venv python3-pip bluez libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf build-essential libopenjp2-7 libtiff6 libturbojpeg0-dev tzdata ffmpeg liblapack3 liblapack-dev libatlas-base-dev

The error is:

E: Unable to locate package libtiff6

Also, this command:

python3 -m pip install wheel

Installs a version of python (3.10) which is out of date and therefore doesn't allow the following command to work:

pip3 install homeassistant==2023.11.2

as it lists out all the available versions and they end at 2023.7.x

I had to follow the instructions here to add the deadsnakes PPA to be able to get the newer version of Python 3.11 which then allowed me to run the above command to get HASS 2023.11.2.

I'm currently stuck on trying to run HASS for the first time because I get the following errors:

homeassistant@Dell:/home/dan$ hass Traceback (most recent call last): File "/usr/lib/command-not-found", line 28, in from CommandNotFound import CommandNotFound File "/usr/lib/python3/dist-packages/CommandNotFound/CommandNotFound.py", line 19, in from CommandNotFound.db.db import SqliteDatabase File "/usr/lib/python3/dist-packages/CommandNotFound/db/db.py", line 5, in import apt_pkg ModuleNotFoundError: No module named 'apt_pkg'

It would be great if someone who knows what they're doing (not me!) could do a fresh Windows 11 and WSL+Ubuntu install and follow the guide through from the beginning. You'll find that the guide is pretty broken at the moment and needs updating!

Any tips on how to get HASS running would be much appreciated.

URL

https://www.home-assistant.io/installation/windows/

Version

2023.11.2

Additional information

No response

barmalej1 commented 9 months ago

I am in the same boat. Please help!

barmalej1 commented 9 months ago

Got it working. I started with a fresh copy of Ubuntu 22.04 in WSL on Server 2022:

1.Install Ubuntu 22.04 in WSL wsl.exe --install --d Ubuntu-22.04

  1. Update the OS sudo apt update && sudo apt upgrade -y
  2. Install libtiff5 sudo apt install libtiff5 -y Install python3.11 sudo add-apt-repository ppa:deadsnakes/ppa. Press Enter to continue sudo apt update sudo apt install python3.11 python3.11-dev python3.11-venv -y
  3. Install the dependencies sudo apt-get install -y python3-pip bluez libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf build-essential libopenjp2-7 libturbojpeg0-dev tzdata ffmpeg liblapack3 liblapack-dev libatlas-base-dev
  4. Install Python switcher sudo update-alternatives --install /usr/bin/python3 python /usr/bin/python3.10 1 sudo update-alternatives --install /usr/bin/python3 python /usr/bin/python3.11 2
  5. Set Python 3.11 as default sudo update-alternatives --set python /usr/bin/python3.11
  6. Make sure the current version of Python is 3.11 python3 --version
  7. Create an account sudo useradd -rm homeassistant
  8. Create the virtual environment sudo mkdir /srv/homeassistant sudo chown homeassistant:homeassistant /srv/homeassistant sudo -u homeassistant -H -s cd /srv/homeassistant python3 -m venv . source bin/activate python3 -m pip install wheel pip3 install homeassistant==2023.11.3 pip install git+https://github.com/boto/botocore hass

Steps 6 - 8 are optional. Another option would be to use puthon3.11 instead of python3 in commands from step 10

Now I need to figure out how to auto-start HA

versile2 commented 8 months ago

Thanks for the help, worked well for me. Did you figure out how to auto start ha?

ticticker commented 5 months ago

Thanks I followed all of above as i had already HA installed it kept asking for password for home assistant now stuck
any suggestions

ticticker commented 5 months ago

" File "/srv/homeassistant/lib/python3.11/site-packages/homeassistant/loader.py", line 824, in get_component raise ImportError(f"Exception importing {self.pkg_path}") from err ImportError: Exception importing homeassistant.components.mobile_app 2024-03-31 15:06:01.993 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of default_config. Setup failed for dependencies: cloud, mobile_app 2024-03-31 15:06:01.994 ERROR (MainThread) [homeassistant.setup] Setup failed for default_config: (DependencyError(...), 'Could not setup dependencies: cloud, mobile_app')" end result to above installation

where is my error

versile2 commented 5 months ago

I ended up abandoning this approach and went with VirtualBox to host HA. I've had very few issues since. The only thing special I had to do there was create a batch file to start my HA instance on reboot headless so it always ran even when windows forced restarts repeatedly. I've now managed to install proxmox, follow the setup for HA there, then replace the "set hard drive" with my vdi image from VirtualBox and it worked like a champ.

V

andreshs1 commented 1 month ago

Got it working. I started with a fresh copy of Ubuntu 22.04 in WSL on Server 2022:

1.Install Ubuntu 22.04 in WSL wsl.exe --install --d Ubuntu-22.04 2. Update the OS sudo apt update && sudo apt upgrade -y 3. Install libtiff5 sudo apt install libtiff5 -y Install python3.11 sudo add-apt-repository ppa:deadsnakes/ppa. Press Enter to continue sudo apt update sudo apt install python3.11 python3.11-dev python3.11-venv -y 5. Install the dependencies sudo apt-get install -y python3-pip bluez libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf build-essential libopenjp2-7 libturbojpeg0-dev tzdata ffmpeg liblapack3 liblapack-dev libatlas-base-dev 6. Install Python switcher sudo update-alternatives --install /usr/bin/python3 python /usr/bin/python3.10 1 sudo update-alternatives --install /usr/bin/python3 python /usr/bin/python3.11 2 7. Set Python 3.11 as default sudo update-alternatives --set python /usr/bin/python3.11 8. Make sure the current version of Python is 3.11 python3 --version 9. Create an account sudo useradd -rm homeassistant 10. Create the virtual environment sudo mkdir /srv/homeassistant sudo chown homeassistant:homeassistant /srv/homeassistant sudo -u homeassistant -H -s cd /srv/homeassistant python3 -m venv . source bin/activate python3 -m pip install wheel pip3 install homeassistant==2023.11.3 pip install git+https://github.com/boto/botocore hass

Steps 6 - 8 are optional. Another option would be to use puthon3.11 instead of python3 in commands from step 10

Now I need to figure out how to auto-start HA

Thanks!!! spent hours yesterday trying to figure out why, after following all the steps, it was not working, and it all came down to pip install git+https://github.com/boto/botocore

Great write-up, super useful

Now just trying to figure out the auto start of HASS when windows restarts

Regards Andres