Can't update to 0.77 on raspberry pi zero [SOLVED]

Hi,

Currently i’m running hassbian 0.71.0 on my raspberry and i want to update to the latest version.
But when i run python3 -m pip install --upgrade homeassistant in the virtual environment it spits errors.

(homeassistant) homeassistant@raspberrypi:/srv/homeassistant$ python3.5 -m pip install --upgrade homeassistant
The directory '/home/homeassistant/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/home/homeassistant/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting homeassistant
  Downloading https://files.pythonhosted.org/packages/24/ce/f6bd8738ff1f7d2a91a64d7d468e9718f4eb71a1a43a0fb6c0a14ddc86a1/homeassistant-0.77.3-py3-none-any.whl (2.9MB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 2.9MB 31kB/s
Requirement already up-to-date: attrs==18.1.0 in ./lib/python3.5/site-packages (from homeassistant)
Collecting pip>=8.0.3 (from homeassistant)
  Downloading https://files.pythonhosted.org/packages/5f/25/e52d3f31441505a5f3af41213346e5b6c221c9e086a166f3703d2ddaf940/pip-18.0-py2.py3-none-any.whl (1.3MB)
100% |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 1.3MB 54kB/s
Collecting aiohttp==3.4.0 (from homeassistant)
Exception:
Traceback (most recent call last):
  File "/srv/homeassistant/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 594, in urlopen
chunked=chunked)
  File "/srv/homeassistant/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 391, in _make_request
six.raise_from(e, None)
  File "<string>", line 2, in raise_from
  File "/srv/homeassistant/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 387, in _make_request
httplib_response = conn.getresponse()
  File "/usr/lib/python3.5/http/client.py", line 1198, in getresponse
response.begin()
  File "/usr/lib/python3.5/http/client.py", line 297, in begin
version, status, reason = self._read_status()
  File "/usr/lib/python3.5/http/client.py", line 266, in _read_status
raise RemoteDisconnected("Remote end closed connection without"
http.client.RemoteDisconnected: Remote end closed connection without response

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
  File "/srv/homeassistant/lib/python3.5/site-packages/pip/commands/install.py", line 342, in run
requirement_set.prepare_files(finder)
  File "/srv/homeassistant/lib/python3.5/site-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
  File "/srv/homeassistant/lib/python3.5/site-packages/pip/req/req_set.py", line 620, in _prepare_file
session=self.session, hashes=hashes)
  File "/srv/homeassistant/lib/python3.5/site-packages/pip/download.py", line 821, in unpack_url
hashes=hashes
  File "/srv/homeassistant/lib/python3.5/site-packages/pip/download.py", line 659, in unpack_http_url
hashes)
  File "/srv/homeassistant/lib/python3.5/site-packages/pip/download.py", line 853, in _download_http_url
stream=True,
  File "/srv/homeassistant/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 501, in get
return self.request('GET', url, **kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/pip/download.py", line 386, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
  File "/srv/homeassistant/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 488, in request
resp = self.send(prep, **send_kwargs)
  File "/srv/homeassistant/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/sessions.py", line 609, in send
r = adapter.send(request, **kwargs)
  File "/srv/homeassistant/share/python-wheels/CacheControl-0.11.7-py2.py3-none-any.whl/cachecontrol/adapter.py", line 47, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
  File "/srv/homeassistant/share/python-wheels/requests-2.12.4-py2.py3-none-any.whl/requests/adapters.py", line 423, in send
timeout=timeout
  File "/srv/homeassistant/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/connectionpool.py", line 643, in urlopen
_stacktrace=sys.exc_info()[2])
  File "/srv/homeassistant/share/python-wheels/urllib3-1.19.1-py2.py3-none-any.whl/urllib3/util/retry.py", line 315, in increment
total -= 1
TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'

Anyone can help me to solve this?

Many thanks!

I would suggest that you spend more than 5 USD on hardware and it will probably work

Just a thought

My hass is running for almost 2 years now, so i don’t see why i need to upgrade on hardware.
I’m looking more for a solution on how to upgrade my hass, not what hardware i should get.
But thanks for the info!

Looks like there was a network glitch while you were downloading. I would just try again shortly.

Seems strange, because i have been trying for almost 3 hours now?
But shall a few more hours :slight_smile:

Do you always get to the same point with the same failure? If so, it might be something local like not enough disk space, but the error reporting is more accurate than that.

I have just upgraded to 0.77.3 on my Pi, so there isn’t a general bottleneck.

The pi has updated HA. But now i get the following error when i want to start HA

Sep 07 09:40:09 hass[1234]:   File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/auth.py", line 15, i
Sep 07 09:40:09 hass[1234]:     from homeassistant import data_entry_flow, requirements
Sep 07 09:40:09 hass[1234]:   File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/requirements.py", li
Sep 07 09:40:09 hass[1234]:     import homeassistant.util.package as pkg_util
Sep 07 09:40:09 hass[1234]:   File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/util/package.py", li
Sep 07 09:40:09 hass[1234]:     import pkg_resources
Sep 07 09:40:09 hass[1234]: ImportError: No module named 'pkg_resources'

Do i need to manually install the module?
If so, how ?

It should happen automatically, but occasionally the devs mess up and miss something.

Enable the HA virtual environment, as if you were going to upgrade HA, then

(homeassistant) homeassistant@lubuntu-1804:~
$ pip list

will give you a list of installed packages in the venv. Make sure that pkg-resources is not included. If it is, something has gone wrong that I wouldn’t understand.

Assuming it isn’t already installed do

(homeassistant) homeassistant@lubuntu-1804:~
$ pip install  pkg_resources

which should install the latest version of that package name from pypi.

However, my venv shows a version of 0.0.0 for pkg-resources, which is a little odd, and makes me worry something else is going on here. .:sweat:

If something doesn’t look right, I would be tempted to move that virtual environment aside and create a new one from scratch.

1 Like

I did the most simple solution you provided.
Remove old virtual environment en create a new.
Easy FIX!

1 Like