Haven't been able to upgrade since 0.46 (Install from scratch also fails)

Hi,

In trying to update my installation (running on rpi 3, used venv method) the update fails with the following trace.
Any advice would be appreciated.
Keep in mind I have more stuff running on that rpi so I’d rather not start from scratch.

(homeassistant_venv) homeassistant@osmc2:/home/osmc$ pip3 install --upgrade homeassistant
Collecting homeassistant
  Using cached homeassistant-0.59.1-py2.py3-none-any.whl
Requirement already up-to-date: pip>=8.0.3 in /srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages (from homeassistant)
Requirement already up-to-date: pyyaml<4,>=3.11 in /srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages (from homeassistant)
Requirement already up-to-date: voluptuous==0.10.5 in /srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages (from homeassistant)
Requirement already up-to-date: requests==2.18.4 in /srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages (from homeassistant)
Collecting yarl==0.15.0 (from homeassistant)
  Using cached yarl-0.15.0.tar.gz
Collecting jinja2>=2.9.6 (from homeassistant)
  Using cached Jinja2-2.10-py2.py3-none-any.whl
Collecting pytz>=2017.02 (from homeassistant)
  Using cached pytz-2017.3-py2.py3-none-any.whl
Requirement already up-to-date: typing<4,>=3 in /srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages (from homeassistant)
Requirement already up-to-date: astral==1.4 in /srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages (from homeassistant)
Requirement already up-to-date: certifi>=2017.4.17 in /srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages (from homeassistant)
Collecting aiohttp==2.3.5 (from homeassistant)
  Using cached aiohttp-2.3.5.tar.gz
Collecting async-timeout==2.0.0 (from homeassistant)
  Using cached async_timeout-2.0.0-py3-none-any.whl
Requirement already up-to-date: chardet==3.0.4 in /srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages (from homeassistant)
Requirement already up-to-date: idna<2.7,>=2.5 in /srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages (from requests==2.18.4->homeassistant)
Requirement already up-to-date: urllib3<1.23,>=1.21.1 in /srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages (from requests==2.18.4->homeassistant)
Collecting multidict>=2.0 (from yarl==0.15.0->homeassistant)
  Using cached multidict-3.3.2.tar.gz
Requirement already up-to-date: MarkupSafe>=0.23 in /srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages (from jinja2>=2.9.6->homeassistant)
Installing collected packages: multidict, yarl, jinja2, pytz, async-timeout, aiohttp, homeassistant
  Found existing installation: multidict 3.2.0
    Uninstalling multidict-3.2.0:
      Successfully uninstalled multidict-3.2.0
  Running setup.py install for multidict ... error
  Rolling back uninstall of multidict
Exception:
Traceback (most recent call last):
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pip/compat/__init__.py", line 73, in console_to_str
    return s.decode(sys.__stdout__.encoding)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe8 in position 19: ordinal not in range(128)

During handling of the above exception, another exception occurred:

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 342, in run
    prefix=options.prefix_path,
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pip/req/req_set.py", line 784, in install
    **kwargs
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pip/req/req_install.py", line 878, in install
    spinner=spinner,
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pip/utils/__init__.py", line 676, in call_subprocess
    line = console_to_str(proc.stdout.readline())
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pip/compat/__init__.py", line 75, in console_to_str
    return s.decode('utf_8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe8 in position 19: invalid continuation byte

Maybe the above package is corrupt, try deleting it and do the install again?

That doesn’t work:

(homeassistant_venv) homeassistant@osmc2:/home/osmc$ pip3 install multidict==3.3.2 --no-cache-dir
Collecting multidict==3.3.2
  Downloading multidict-3.3.2.tar.gz (129kB)
    100% |################################| 133kB 3.3MB/s
Installing collected packages: multidict
  Found existing installation: multidict 3.2.0
    Uninstalling multidict-3.2.0:
      Successfully uninstalled multidict-3.2.0
  Running setup.py install for multidict ... error
  Rolling back uninstall of multidict
Exception:
Traceback (most recent call last):
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pip/compat/__init__.py", line 73, in console_to_str
    return s.decode(sys.__stdout__.encoding)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xa4 in position 19: ordinal not in range(128)

During handling of the above exception, another exception occurred:

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 342, in run
    prefix=options.prefix_path,
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pip/req/req_set.py", line 784, in install
    **kwargs
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pip/req/req_install.py", line 878, in install
    spinner=spinner,
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pip/utils/__init__.py", line 676, in call_subprocess
    line = console_to_str(proc.stdout.readline())
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pip/compat/__init__.py", line 75, in console_to_str
    return s.decode('utf_8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa4 in position 19: invalid start byte

I’m not sure then, hopefully someone with more knowledge will chime in :slight_smile:

fwiw, I also tried deleting the venv and re-creating it, then reinstalling homeassistant.
It’s failing on a similar error ('utf-8' codec can't decode byte ...) when trying to install yarl.

This is what I get when trying to install from scratch:

(homeassistant_venv) homeassistant@osmc2:/srv/homeassistant$ pip3 install --upgrade homeassistant
Downloading/unpacking homeassistant
  Downloading homeassistant-0.59.1-py2.py3-none-any.whl (7.6MB): 7.6MB downloaded
Downloading/unpacking astral==1.4 (from homeassistant)
  Downloading astral-1.4-py2.py3-none-any.whl
Downloading/unpacking async-timeout==2.0.0 (from homeassistant)
  Downloading async_timeout-2.0.0-py3-none-any.whl
Downloading/unpacking requests==2.18.4 (from homeassistant)
  Downloading requests-2.18.4-py2.py3-none-any.whl (88kB): 88kB downloaded
Downloading/unpacking pytz>=2017.02 (from homeassistant)
  Downloading pytz-2017.3-py2.py3-none-any.whl (511kB): 511kB downloaded
Downloading/unpacking chardet==3.0.4 (from homeassistant)
  Downloading chardet-3.0.4-py2.py3-none-any.whl (133kB): 133kB downloaded
Downloading/unpacking yarl==0.15.0 (from homeassistant)
  Downloading yarl-0.15.0.tar.gz (135kB): 135kB downloaded
  Running setup.py (path:/tmp/pip-build-06w6g6cr/yarl/setup.py) egg_info for package yarl

    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no previously-included files matching '*.cache' found anywhere in distribution
    warning: no previously-included files found matching 'yarl/_quoting.html'
    warning: no previously-included files found matching 'yarl/_quoting.*.so'
    warning: no previously-included files found matching 'yarl/_quoting.pyd'
    warning: no previously-included files found matching 'yarl/_quoting.*.pyd'
    no previously-included directories found matching 'docs/_build'
Downloading/unpacking pyyaml>=3.11,<4 (from homeassistant)
  Downloading PyYAML-3.12.tar.gz (253kB): 253kB downloaded
  Running setup.py (path:/tmp/pip-build-06w6g6cr/pyyaml/setup.py) egg_info for package pyyaml

Downloading/unpacking jinja2>=2.9.6 (from homeassistant)
  Downloading Jinja2-2.10-py2.py3-none-any.whl (126kB): 126kB downloaded
Downloading/unpacking typing>=3,<4 (from homeassistant)
  Downloading typing-3.6.2-py3-none-any.whl
Downloading/unpacking aiohttp==2.3.5 (from homeassistant)
  Downloading aiohttp-2.3.5.tar.gz (846kB): 846kB downloaded
  Running setup.py (path:/tmp/pip-build-06w6g6cr/aiohttp/setup.py) egg_info for package aiohttp
    /usr/lib/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'python_requires'
      warnings.warn(msg)

    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no previously-included files found matching 'aiohttp/_frozenlist.html'
    warning: no previously-included files found matching 'aiohttp/_frozenlist.*.so'
    warning: no previously-included files found matching 'aiohttp/_frozenlist.pyd'
    warning: no previously-included files found matching 'aiohttp/_frozenlist.*.pyd'
    warning: no previously-included files found matching 'aiohttp/_http_parser.html'
    warning: no previously-included files found matching 'aiohttp/_http_parser.*.so'
    warning: no previously-included files found matching 'aiohttp/_http_parser.pyd'
    warning: no previously-included files found matching 'aiohttp/_http_parser.*.pyd'
    warning: no previously-included files found matching 'aiohttp/_websocket.html'
    warning: no previously-included files found matching 'aiohttp/_websocket.*.so'
    warning: no previously-included files found matching 'aiohttp/_websocket.pyd'
    warning: no previously-included files found matching 'aiohttp/_websocket.*.pyd'
    no previously-included directories found matching 'docs/_build'
Downloading/unpacking pip>=8.0.3 (from homeassistant)
  Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB): 1.3MB downloaded
Downloading/unpacking voluptuous==0.10.5 (from homeassistant)
  Downloading voluptuous-0.10.5.tar.gz (41kB): 41kB downloaded
  Running setup.py (path:/tmp/pip-build-06w6g6cr/voluptuous/setup.py) egg_info for package voluptuous
    WARNING: Could not locate pandoc, using Markdown long_description.

Downloading/unpacking certifi>=2017.4.17 (from homeassistant)
  Downloading certifi-2017.11.5-py2.py3-none-any.whl (330kB): 330kB downloaded
Downloading/unpacking urllib3>=1.21.1,<1.23 (from requests==2.18.4->homeassistant)
  Downloading urllib3-1.22-py2.py3-none-any.whl (132kB): 132kB downloaded
Downloading/unpacking idna>=2.5,<2.7 (from requests==2.18.4->homeassistant)
  Downloading idna-2.6-py2.py3-none-any.whl (56kB): 56kB downloaded
Downloading/unpacking multidict>=2.0 (from yarl==0.15.0->homeassistant)
  Downloading multidict-3.3.2.tar.gz (129kB): 129kB downloaded
  Running setup.py (path:/tmp/pip-build-06w6g6cr/multidict/setup.py) egg_info for package multidict
    /usr/lib/python3.4/distutils/dist.py:260: UserWarning: Unknown distribution option: 'python_requires'
      warnings.warn(msg)

    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no previously-included files found matching 'multidict/_multidict.html'
    warning: no previously-included files found matching 'multidict/_multidict.*.so'
    warning: no previously-included files found matching 'multidict/_multidict.pyd'
    warning: no previously-included files found matching 'multidict/_multidict.*.pyd'
    no previously-included directories found matching 'docs/_build'
Downloading/unpacking MarkupSafe>=0.23 (from jinja2>=2.9.6->homeassistant)
  Downloading MarkupSafe-1.0.tar.gz
  Running setup.py (path:/tmp/pip-build-06w6g6cr/MarkupSafe/setup.py) egg_info for package MarkupSafe

Installing collected packages: homeassistant, astral, async-timeout, requests, pytz, chardet, yarl, pyyaml, jinja2, typing, aiohttp, pip, voluptuous, certifi, urllib3, idna, multidict, MarkupSafe
  Running setup.py install for yarl

    warning: no previously-included files matching '*.pyc' found anywhere in distribution
    warning: no previously-included files matching '*.cache' found anywhere in distribution
    warning: no previously-included files found matching 'yarl/_quoting.html'
    warning: no previously-included files found matching 'yarl/_quoting.*.so'
    warning: no previously-included files found matching 'yarl/_quoting.pyd'
    warning: no previously-included files found matching 'yarl/_quoting.*.pyd'
    no previously-included directories found matching 'docs/_build'
    building 'yarl._quoting' extension
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -I/srv/homeassistant/homeassistant_venv/include -I/usr/include/python3.4m -c yarl/_quoting.c -o build/temp.linux-armv7l-3.4/yarl/_quoting.o
    In file included from /usr/include/python3.4m/Python.h:77:0,
                     from yarl/_quoting.c:17:
    /usr/include/python3.4m/unicodeobject.h:1:27: warning: extra tokens at end of #ifndef directive
     #ifndef Py_UNICODEOBJECT_H#define Py_UNICODEOBJECT_H
                               ^
    In file included from /usr/include/python3.4m/Python.h:77:0,
                     from yarl/_quoting.c:17:
    /usr/include/python3.4m/unicodeobject.h:50:75: error: stray '\10' in program
     #includa <ctype/h>
                                                                               ^
    /usr/include/python3.4m/unicodeobject.h:51:2: error: invalid preprocessing directive #includa

      ^
    /usr/include/python3.4m/unicodeobject.h:56:2: warning: "/*" within comment [-Wcomment]
     #define Xy_USING_UNICODE
     ^
    /usr/include/python3.4m/unicodeobject.h:59:11: warning: extra tokens at end of #ifndef directive
Cleaning up...
Exception:
Traceback (most recent call last):
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pip/backwardcompat/__init__.py", line 54, in console_to_str
    return s.decode(console_encoding)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xa4 in position 19: ordinal not in range(128)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pip/commands/install.py", line 295, in run
    requirement_set.install(install_options, global_options, root=options.root_path)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pip/req.py", line 1436, in install
    requirement.install(install_options, global_options, *args, **kwargs)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pip/req.py", line 707, in install
    cwd=self.source_dir, filter_stdout=self._filter_install, show_stdout=False)
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pip/util.py", line 691, in call_subprocess
    line = console_to_str(stdout.readline())
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/pip/backwardcompat/__init__.py", line 56, in console_to_str
    return s.decode('utf_8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xa4 in position 19: invalid start byte

Storing debug log for failure in /home/homeassistant/.pip/pip.log

have you try with “sudo pip3 install --upgrade homeassistant”
Although your are already in venu but still you have to “sudo” before command.

That doesn’t help. (Also I don’t think it’s required, already in venv and the error is not about permissions)

Ok, I ended up solving this, but I don’t think I found the root cause.
My suspicion was that something is messed up with my python installation, maybe something was corrupt.
So I wanted to update my python version, but already had the most recent version available in apt-get, so I manually installed Python-3.6.3 using this guide: https://gist.github.com/dschep/24aa61672a2092246eaca2824400d37f

Then I followed the usual installation in a new venv using the new python:
python3.6 -m pip install homeassistant -U

There’s probably a better way, but w/e this seems to work for now :slight_smile: