CentOS 7 - Home Assistant

Hi all,

I have been reading through the documentation and have tried some installs on CentOS 7, and continue to run into issues/errors when trying to launch hass.

I was wondering if there were any guides for CentOS 7 and Home Assistant. The instructions seem pretty straight forward but are very generic.

Thanks,
Dave

1 Like

You followed this :==> https://home-assistant.io/docs/installation/centos/ ?

I have not installed on CentOS, but you are right it looks pretty consistent and straight fwd. What errors are you running into?

Everything seems to go ok, all the way through installing homeassistant in the virtual environment. Than I get:

python: error while loading shared libraries: libpython3.5m.so.1.0: cannot open shared object file: No such file or directory

When I try to run hass

I tried it as well. Centos doesn’t seem to setup python correctly. As best I can tell, only root can run python since the libraries are all installed in directories owned by root.

rh-python35-python-pip-7.1.0-2.el7.noarch : A tool for installing and managing Python packages
Repo : centos-sclo-rh
Matched from:
Filename : /opt/rh/rh-python35/root/usr/lib/python3.5/site-packages/pip
Filename : /opt/rh/rh-python35/root/usr/bin/pip

1 Like

Interesting. Thanks for the help. I ditched the Virtual Environment and installed everything as root. Onto the configuration issues w/ .40

Thanks for your help!

I know this is old, but if it might help others using CentOS 7. The lib files are readable by your homeassistant user, you just need to update the LD_LIBRARY_PATH variable for that user. I did it by adding the following line at /home/homeassistant/.bashrc (adjust depending on your username and home dir):

export LD_LIBRARY_PATH=/opt/rh/rh-python35/root/usr/lib64

Then restart hass and it will now start w/o the library error.

Okay, so adding the variable to homassistant’s .bashrc only worked for an interactive shell, but starting in the systemd service was still giving the same library error. I was able to fix it by updating ld.so.conf. I created a new file /etc/ld.so.conf.d/libpython35.conf and added the following line:

    /opt/rh/rh-python35/root/usr/lib64

Then executing:

    $ sudo ldconfig

I give credit here for the idea:

How do I ditch the virtual env ?

I was able to get it running once in a remote putty session to my home linux box.

Now when I try to run it again directly on the linux box

[xxx@LinuxServer /]$ $HOME/homeassistant/bin/hass
/home/xxx/homeassistant/bin/python3: error while loading shared libraries: libpython3.5m.so.rh-python35-1.0: cannot open shared object file: No such file or directory

I got it running again but the log files show errors. Anyone know how to fix these errors? There is a fix in debian in the troubleshooting section to fix the discovery but nothing for Centos.

2017-11-20 14:34:28 WARNING (MainThread) [homeassistant.setup] Setup of sensor is taking over 10 seconds.
2017-11-20 14:34:31 ERROR (Thread-5) [homeassistant.util.package] Unable to install package netdisco==1.2.3: Command “/root/homeassistant/bin/python3 -u -c “import setuptools, tokenize;file=’/tmp/pip-build-i6swgk0e/netifaces/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(’\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” install --record /tmp/pip-ge89j9uh-record/install-record.txt --single-version-externally-managed --compile --install-headers /root/homeassistant/include/site/python3.5/netifaces” failed with error code 1 in /tmp/pip-build-i6swgk0e/netifaces/
2017-11-20 14:34:31 ERROR (MainThread) [homeassistant.setup] Not initializing discovery because could not install dependency netdisco==1.2.3
2017-11-20 14:34:31 ERROR (MainThread) [homeassistant.setup] Setup failed for discovery: Could not install all requirements.

running this solved my issue

root:~# yum install perl-core perl-DBD-Pg net-snmp-perl net-snmp-devel openssl-devel make automake gcc

Hi Guys i am also getting the same error but permission denied

httpd: Syntax error on line 43 of /etc/httpd/conf/httpd.conf: Cannot load modules/mod_wsgi.so into server: libpython3.5m.so.1.0: cannot open shared object file: Permission denied

i tried by adding in

export LD_LIBRARY_PATH=/opt/rh/rh-python35/root/usr/lib64

and

/opt/rh/rh-python35/root/usr/lib64 in file etc/ld.so.conf.d/libpython35.conf 

as well install

yum install perl-core perl-DBD-Pg net-snmp-perl net-snmp-devel openssl-devel make automake gcc

but all these are not able to solve my problem.
can some one help me in this matter.

Thanks

Hi Guys i got the solution you should not keep the build file at /home or child dir.
i moved and things worked for me.

Cheers.