27.2 AIO Upgrade failed

Did a clean install of HA last week via the AIO installer and then noticed this week there is an update available to 27.2, I followed the instructions on the AIO page to upgrade and it seemed to happily complete updating however after rebooting it seems that I’m missing a dependency, where do I go from here?
Log:
http://pastebin.com/7TBcFy1Y

I would try running the update again. It won’t install anything that is already up to date but may pick up the missing item.

Yeah, I retried using both methods (logging in to the virtualenv and via fabric). The list of dependencies it rattles through doesn’t even mention sqlalchemy as far as I can see.

I do notice that it complains:
could not install dependency sqlalchemy==1.0.14

The latest version of SQL Alchemy is now 1.0.15, do I need to change a script file somewhere or wait for it to be updated?

I’m also having this issue with my AIO installation. Has been occurring since about 33.0 (have upgraded a few times and I am now on 33.4

homeassistant.bootstrap: Not initializing recorder because could not install dependency sqlalchemy==1.1.3

I tried manually installing SQLAlchemy in the virtual environment but that hasn’t resolved the issue (perhaps because the latest version it installed is 1.1.4?)

Any suggestions are very welcome.

Seriously, so often I’m dissappointed at the lack of support on this forum.

For you guys (and anyone else stumbling upon this looking for help like I did), you should find the following commands useful:

Do the usual update:
sudo su -s /bin/bash hass
source /srv/hass/hass_venv/bin/activate
pip3 install --upgrade homeassistant

And this is the command you’ve been waiting for:
pip3 install sqlalchemy==1.1.4

reboot.

Hope this helps. :slight_smile:

Same trouble here.
I did: pip3 install sqlalchemy==1.1.4 but still have errors.
but there is still a problem - apparently with installing sqlalchemy:

Any clue?

pip3.4 install sqlalchemy==1.1.4
Collecting sqlalchemy==1.1.4
Exception:
Traceback (most recent call last):
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pip/commands/install.py", line 324, in run
    requirement_set.prepare_files(finder)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pip/req/req_set.py", line 380, in prepare_files
    ignore_dependencies=self.ignore_dependencies))
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pip/req/req_set.py", line 620, in _prepare_file
    session=self.session, hashes=hashes)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pip/download.py", line 821, in unpack_url
    hashes=hashes
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pip/download.py", line 659, in unpack_http_url
    hashes)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pip/download.py", line 853, in _download_http_url
    stream=True,
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pip/_vendor/requests/sessions.py", line 488, in get
    return self.request('GET', url, **kwargs)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pip/download.py", line 386, in request
    return super(PipSession, self).request(method, url, *args, **kwargs)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pip/_vendor/requests/sessions.py", line 475, in request
    resp = self.send(prep, **send_kwargs)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pip/_vendor/requests/sessions.py", line 596, in send
    r = adapter.send(request, **kwargs)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pip/_vendor/cachecontrol/adapter.py", line 37, in send
    cached_response = self.controller.cached_request(request)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pip/_vendor/cachecontrol/controller.py", line 111, in cached_request
    resp = self.serializer.loads(request, cache_data)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pip/_vendor/cachecontrol/serialize.py", line 114, in loads
    return getattr(self, "_loads_v{0}".format(ver))(request, data)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pip/_vendor/cachecontrol/serialize.py", line 176, in _loads_v2
    cached = json.loads(zlib.decompress(data).decode("utf8"))
zlib.error: Error -3 while decompressing data: incorrect data check

Did anyone find a solution to this? I’ve just updated to HASS version 0.49.1 and am running into this problem now:

Jul 26 22:29:36 centbox scl[4680]: INFO:homeassistant.util.package:Attempting install of sqlalchemy==1.1.11
Jul 26 22:29:40 centbox scl[4680]: ERROR:homeassistant.util.package:Unable to install package sqlalchemy==1.1.11: Exception:
Jul 26 22:29:40 centbox scl[4680]: Traceback (most recent call last):
Jul 26 22:29:40 centbox scl[4680]: File "/opt/homeassistant/lib/python3.5/site-packages/pip/basecommand.py", line 211, in main
Jul 26 22:29:40 centbox scl[4680]: status = self.run(options, args)
Jul 26 22:29:40 centbox scl[4680]: File "/opt/homeassistant/lib/python3.5/site-packages/pip/commands/install.py", line 351, in run
Jul 26 22:29:40 centbox scl[4680]: for item in os.listdir(lib_dir):
Jul 26 22:29:40 centbox scl[4680]: FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmpt8leil68/lib/python'
Jul 26 22:29:40 centbox scl[4680]: ERROR:homeassistant.setup:Not initializing recorder because could not install dependency sqlalchemy==1.1.11
Jul 26 22:29:40 centbox scl[4680]: ERROR:homeassistant.setup:Setup failed for recorder: Could not install all requirements.

I’ve attempted to fix the issue like in the past by starting up the virtualenv and then running the pip install commands manually. (I’ve installed home assistant to /opt/homeassistant.)

I was getting non-stop errors trying to run “pip3 install sqlalchemy==1.1.1” with “failed building wheel for sqlalchemy” until I found the command “pip install --upgrade wheel”. After I did that and wheel updated I was then able to run the pip install command for sqlalchemy.

However, when I just install it using “pip3 install sqlalchemy==1.1.1” within the virtualenv it goes in successfully, but home assistant still errors out with above. So then I thought it might be because I have home assistant installed to /opt/homeassistant so then I tried installing it with:

(homeassistant)[[email protected] homeassistant]# pip3 install sqlalchemy==1.1.1 --target /opt/homeassistant/deps --upgrade
Collecting sqlalchemy==1.1.1
Installing collected packages: sqlalchemy
Successfully installed sqlalchemy-1.1.1
Exception:
Traceback (most recent call last):
  File "/opt/homeassistant/lib/python3.5/site-packages/pip/basecommand.py", line 211, in main
    status = self.run(options, args)
  File "/opt/homeassistant/lib/python3.5/site-packages/pip/commands/install.py", line 351, in run
    for item in os.listdir(lib_dir):
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/tmpoc2lfavh/lib/python'
(homeassistant)[[email protected] homeassistant]#

So now I have no idea what to do. Anyone having problems with sqlalchemy?

EDIT: I THINK I HAVE A SOLUTION:

I ended up finding a work around for this… kinda. I don’t know if it is the correct way to do it, and it doesn’t solve the underlining problem. But it works.

Since the “pip3 install sqlalchemy==1.1.11” works without a problem, it’s when you try to run it with the --target attribute it fails. I figured, why not just move the files manually over after it’s installed to the default location. So that’s exactly what I did.

So from within your virtualenv:

(homeassistant)[[email protected] homeassistant]# pip3 install sqlalchemy==1.1.11

After it installs successfully, then you can do:

(homeassistant)[[email protected] homeassistant]# pip3 install sqlalchemy==1.1.11
Requirement already satisfied (use --upgrade to upgrade): sqlalchemy==1.1.11 in ./lib/python3.5/site-packages
(homeassistant)[[email protected] homeassistant]# cd lib/python3.5/site-packages/
(homeassistant)[[email protected] site-packages]# ll
drwxr-xr-x 13 root root  4096 Jul 27 10:45 sqlalchemy
drwxr-xr-x  2 root root   108 Jul 27 10:45 SQLAlchemy-1.1.11.dist-info
(homeassistant)[[email protected] site-packages]# cp -r sqlalchemy /opt/homeassistant/deps/
(homeassistant)[[email protected] site-packages]# cp -r SQLAlchemy-1.1.11.dist-info /opt/homeassistant/deps/

Then stop and restart home assistant. Worked for me.

Don’t forget to change your paths, since I installed home assistant to /opt/.

I feel your frustration. Home Assistant is amazing when it works, but I’ve had such a hard time getting it running properly. I have a feeling it is python to blame.

1 Like