Updating to 0.29.7 fails

I have recently installed HA manually on an R Pi 3 and have it working with some MQTT components and auto starting. I tried to update it because I thought it might solve the issue I’m having connecting to Nest Thermostat, but it fails, and throws some exceptions. Any Ideas?

homeassistant@raspberrypi:/srv/homeassistant $ pip3 install --upgrade homeassistant
Downloading/unpacking homeassistant
  Downloading homeassistant-0.29.7-py2.py3-none-any.whl (6.2MB): 6.2MB downloaded
Downloading/unpacking pytz>=2016.6.1 (from homeassistant)
  Downloading pytz-2016.7-py2.py3-none-any.whl (480kB): 480kB downloaded
Downloading/unpacking requests>=2,<3 from https://pypi.python.org/packages/ea/03/92d3278bf8287c5caa07dbd9ea139027d5a3592b0f4d14abf072f890fab2/requests-2.11.1-py2.py3-none-any.whl#md5=b4269c6fb64b9361288620ba028fd385 (from homeassistant)
  Downloading requests-2.11.1-py2.py3-none-any.whl (514kB): 514kB downloaded
Downloading/unpacking pyyaml>=3.11,<4 (from homeassistant)
  Downloading PyYAML-3.12.tar.gz (253kB): 253kB downloaded
  Running setup.py (path:/tmp/pip-build-9jl9m8l_/pyyaml/setup.py) egg_info for package pyyaml
    
Downloading/unpacking typing>=3,<4 (from homeassistant)
  Downloading typing-3.5.2.2.tar.gz (51kB): 51kB downloaded
  Running setup.py (path:/tmp/pip-build-9jl9m8l_/typing/setup.py) egg_info for package typing
    
Downloading/unpacking voluptuous==0.9.2 (from homeassistant)
  Downloading voluptuous-0.9.2.tar.gz
  Running setup.py (path:/tmp/pip-build-9jl9m8l_/voluptuous/setup.py) egg_info for package voluptuous
    WARNING: Could not locate pandoc, using Markdown long_description.
    
Downloading/unpacking jinja2>=2.8 (from homeassistant)
  Downloading Jinja2-2.8-py2.py3-none-any.whl (263kB): 263kB downloaded
Downloading/unpacking pip>=7.0.0 (from homeassistant)
  Downloading pip-8.1.2-py2.py3-none-any.whl (1.2MB): 1.2MB downloaded
Downloading/unpacking setuptools>=0.6b1 from https://pypi.python.org/packages/be/20/3f4d2fb59ddeed35532bd4e11e900abcf8019d29f4558d38169639303536/setuptools-28.2.0-py2.py3-none-any.whl#md5=02e79b1127c5a131a2dace6d30cf7f25 (from voluptuous==0.9.2->homeassistant)
  Downloading setuptools-28.2.0-py2.py3-none-any.whl (467kB): 467kB downloaded
Downloading/unpacking MarkupSafe (from jinja2>=2.8->homeassistant)
  Downloading MarkupSafe-0.23.tar.gz
  Running setup.py (path:/tmp/pip-build-9jl9m8l_/MarkupSafe/setup.py) egg_info for package MarkupSafe
    
Installing collected packages: homeassistant, pytz, requests, pyyaml, typing, voluptuous, jinja2, pip, setuptools, MarkupSafe
Cleaning up...
Exception:
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 122, in main
    status = self.run(options, args)
  File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 295, in run
    requirement_set.install(install_options, global_options, root=options.root_path)
  File "/usr/lib/python3/dist-packages/pip/req.py", line 1436, in install
    requirement.install(install_options, global_options, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/pip/req.py", line 672, in install
    self.move_wheel_files(self.source_dir, root=root)
  File "/usr/lib/python3/dist-packages/pip/req.py", line 902, in move_wheel_files
    pycompile=self.pycompile,
  File "/usr/lib/python3/dist-packages/pip/wheel.py", line 214, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/usr/lib/python3/dist-packages/pip/wheel.py", line 204, in clobber
    os.makedirs(destdir)
  File "/usr/lib/python3.4/os.py", line 237, in makedirs
    mkdir(name, mode)
PermissionError: [Errno 13] Permission denied: '/usr/local/lib/python3.4/dist-packages/homeassistant'

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

Looks like you are running the upgrade as a different user to the one who installed it. Is this AIO? If so you should upgrade as the hass user and use the virtual environment. If not, you should probably use sudo to run the install as root.

I followed the manual installation instructions, so, that was done with the homeassistant user, same user that the installation was initially done under. But it was initially done in the virtual environment as well- do I need to be in the virtual environment?

(homeassistant_venv) homeassistant@raspberrypi:/srv/homeassistant $ pip3 install --upgrade homeassistant

Or do I run it as sudo, but not in venv:

homeassistant@raspberrypi:/srv/homeassistant $ sudo pip3 install --upgrade homeassistant

Your output looks correct but whatever you do DO NOT run it as sudo! Not sure what the issue is but just wanted to warn you against trying this.

1 Like

Ok! Yes I was skeptical about that… I am going to do as @aimc suggested and run it as has user in venv:

(homeassistant_venv) homeassistant@raspberrypi:/srv/homeassistant $ pip3 install --upgrade homeassistant

@aimc- This is not what you suggested specifically, or idk it kindof is?— Though this isn’t AIO, I ended up running it in the virtual environment and that worked. So thank you.

(homeassistant_venv) homeassistant@raspberrypi:/srv/homeassistant $ pip3 install --upgrade homeassistant

I guess your environment was similar enough to the AIO that my suggestion worked :slight_smile: Glad you figured it out.

1 Like

I am having the hardest time upgrading HASS. How do I switch to the homeassistant user I created in the manual installation of HASS? I am getting permission errors.

I figured it out. I did the following to get to the right user that was created in the manual setup

I ssh to my [email protected] and used my password

I then switched users to sudo su homeassistant

I then switched to the virtual enviroment source /srv/homeassistant/homeassistant_venv/bin/activate

I then upgraded HA pip3 install --upgrade homeassistant