Upgrade fails for 0.59.2

I get the following error when trying to upgrade to 0.59.2

  Found existing installation: homeassistant 0.59.1
    Uninstalling homeassistant-0.59.1:
Exception:
Traceback (most recent call last):
  File "/usr/lib/python3.5/shutil.py", line 544, in move
    os.rename(src, real_dst)
PermissionError: [Errno 13] Permission denied: '/home/pi/homeassistant/lib/python3.5/site-packages/homeassistant-0.59.1.dist-info/DESCRIPTION.rst' -> '/tmp/pip-d_s73s78-uninstall/home/pi/homeassistant/lib/python3.5/site-packages/homeassistant-0.59.1.dist-info/DESCRIPTION.rst'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pi/homeassistant/lib/python3.5/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/home/pi/homeassistant/lib/python3.5/site-packages/pip/commands/install.py", line 360, in run
    prefix=options.prefix_path,
  File "/home/pi/homeassistant/lib/python3.5/site-packages/pip/req/req_set.py", line 778, in install
    requirement.uninstall(auto_confirm=True)
  File "/home/pi/homeassistant/lib/python3.5/site-packages/pip/req/req_install.py", line 754, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "/home/pi/homeassistant/lib/python3.5/site-packages/pip/req/req_uninstall.py", line 115, in remove
    renames(path, new_path)
  File "/home/pi/homeassistant/lib/python3.5/site-packages/pip/utils/__init__.py", line 267, in renames
    shutil.move(old, new)
  File "/usr/lib/python3.5/shutil.py", line 559, in move
    os.unlink(src)
PermissionError: [Errno 13] Permission denied: '/home/pi/homeassistant/lib/python3.5/site-packages/homeassistant-0.59.1.dist-info/DESCRIPTION.rst'

Any ideas what I can do about it?

You just installed under the pi user?

Nope virtual env

Under the pi user, or do you have a homeassistant user?

Homeassistant user …

sudo su -s /bin/bash homeassistant
source /home/pi/homeassistant/bin/activate
pip3 install --upgrade homeassistant

OK, not sure how you’ve ended up with your files under the pi user then, but this should fix it:

From pi user…

sudo chown -R homeassistant:homeassistant /home/pi/homeassistant 

Just to clarify, you’re sure your installation isn’t at /home/homeassistant (no pi in the middle)?

That worked:) many thanks :smiley:
Probably due to the slightly confusing installation instructions :stuck_out_tongue:

No worries :slight_smile: