I have an intel nuc with ubuntu and installed home assistant with the command “pip3 install homeassistant”. Finished, that was it. No docker, no virtual environment, no hassio, no hassbian. But it seems I’m the only one running it as a plain python program. Why nobody runs the python program?
Read here about python virtual environments:
Home Assistant has its own python environment which is not shared with the machine. So you don’t need to worry about that.
Many do.
A large number of people now choose to use Hass.io due to the add-ons available and the convienience factor of being able to ‘1 click install’ software that will work directly with HA.
Having programs run in a self contained docker container, with all the dependencies they require isolated from the rest of the OS, and immune from being corrupted by an OS update, is the most attractive part.
Venv works in a similar way, but from my experience, Docker is far easier to manage.
Not true, I’m running it this way in full fat virtual machine on proxmox, and I’ve spoken on here to others that have in running that way as a container.
It’s just easier, quicker and give access to more features to go the hass.io/docker route.
For me I have SSH scripts which was a pain to get working correctly in hass.io when I tried it, so just went the pip way.
No it doesn’t, unless YOU specify the environment.
Because dependencies and app versions are a bitch to deal with. What happens in a year when python has changed versions, or you want to install some other app on your server that has a conflicting version of “something”?
Containerization, whether docker or python virtual environment, is the answer to that.
Home Assistant manages the python modules it needs by its own. They are installed within the .homeassitant directory and not in the system directory.
Which is 100% NOT the same thing as a python virtual environment.
Just a few months ago was a python update in Home Assistant. Those running in python had a hard time getting their python versions updated. The python virtual environment helps with that.
Trust me, a pip3 install home-assistant doesn’t go into a virtual environment unless YOU specify it to.
Basically, even the official instructions tell you to use a virtual environment…
It’s recommended when installing Python packages that you use a virtual environment. This will make sure that your Python installation and Home Assistant installation won’t impact one another. The following steps will work on most UNIX like systems.
Trust me, THAT is not a virtual environment…
Again, the official documentation tells you how to activate a python virtual environment.
It appears you want to argue for the sake of arguing, but indeed, you are not running a virtual environment. You will find this out when python versions change again.
??
Python version IS shared with the machine, so this is inaccurate.
Guys stop that silliness. It’s that very behaviour that turns potential users off. You’ve both made your points now so move on.
What behavior? Correcting an inaccuracy in the assumption of how the system works?
Seems weird that we wouldn’t want accurate information out there for potential users.
As I said you made your point. The user can decide for themselves.
I run the plain python program under VENV.
I used to run HassIO as I quite like the NGINX addon.
However I was having DNS issue with the whole HassIO platform, so have now gone the to VENV “pip3 install homeassistant” based setup and couldn’t be happier.
Also Config check for example would take over 1 min on Hassio while it takes less than 10 seconds on VENV.
Also I think with hassio you cannot access the sources or configuration files?
What sources and configuration files do you mean? configuration.yaml etc.?
Configuration files are accessible, or you wouldn’t be able to configure the system. A lot of integrations/components still require you to add to the configuration yaml.
HOW you access these files is different on hassio. You should set up samba or ssh to access the configuration in a hassio system.
What “sources” do you need access to? Technically you can access the python files in the installation, but that’s not the right way to manage a docker system (Hassio runs Docker), as any changes made to the python files will be reverted on next update or restart.
Configurations are configuration.yaml and sources are the python source modules. I changed a lot of modules to fix bugs.
Of course configuration is accessible in hass.io, otherwise you would not be able to configure the system.
For sources take a look at @flamingm0e answer above.
Do you change the python files of included components? I don’t think that’s a good idea, wouldn’t it be better to create a custom component? Otherwise you’ll lose all changes when you update your system.
If you’re fixing bugs you need to be contributing to the project…