home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.47k stars 30.69k forks source link

Old dependancies are not removed during upgrade #12461

Closed doudz closed 6 years ago

doudz commented 6 years ago

Home Assistant release (hass --version): 0.63.2 Trying to use wake on lan I got the following traceback

Error executing service <ServiceCall switch.turn_on: entity_id=['switch.serveur']>
Traceback (most recent call last):
  File "/usr/local/lib/python3.5/dist-packages/homeassistant/core.py", line 1010, in _event_to_service_call
    yield from service_handler.func(service_call)
  File "/usr/local/lib/python3.5/dist-packages/homeassistant/components/switch/__init__.py", line 111, in async_handle_switch_service
    yield from switch.async_turn_on()
  File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.5/dist-packages/homeassistant/components/switch/wake_on_lan.py", line 87, in turn_on
    self._wol.send_magic_packet(self._mac_address)
AttributeError: module 'wakeonlan' has no attribute 'send_magic_packet'

It works on previous version 0.61, not sure on 0.62 since I upgrade from 0.61 to 0.63

doudz commented 6 years ago

I found the problem, previous wakeonlan version wasn't removed from deps, don't know why...

~/.homeassistant/deps/lib/python3.5/site-packages $ ls|grep wake
wakeonlan
wakeonlan-0.2.2.dist-info
wakeonlan-1.0.0.dist-info
wakeonlan.py

remove it manually fix the problem

doudz commented 6 years ago

Since the problem happens for many package for me, I change the issue title As you can see, I got many version of the same library (so I decided to remove the deps folder and restart HA)

~/.homeassistant/deps/lib/python3.5/site-packages $ ls
Adafruit_GPIO
Adafruit_GPIO-1.0.3.dist-info
Adafruit_PCA9685
Adafruit_PCA9685-1.0.1.dist-info
Adafruit_PureIO
Adafruit_PureIO-0.2.1.dist-info
aiohttp
aiohttp-2.3.2.dist-info
aiohttp-2.3.7.dist-info
aiohttp_cors
aiohttp_cors-0.5.3.dist-info
aiohttp_cors-0.6.0.dist-info
async_timeout
async_timeout-2.0.0.dist-info
certifi
certifi-2017.11.5.dist-info
certifi-2018.1.18.dist-info
chardet
chardet-3.0.4.dist-info
colorlog
colorlog-3.0.1.dist-info
distro-1.0.4.dist-info
distro-1.1.0.dist-info
distro-1.2.0.dist-info
distro.py
easy_install.py
fuzzywuzzy
fuzzywuzzy-0.15.1.dist-info
fuzzywuzzy-0.16.0.dist-info
hass_frontend
hass_frontend_es5
home_assistant_frontend-20171118.0.dist-info
home_assistant_frontend-20171121.0.dist-info
home_assistant_frontend-20171204.0.dist-info
home_assistant_frontend-20171216.0.dist-info
home_assistant_frontend-20180112.0.dist-info
home_assistant_frontend-20180209.0.dist-info
idna
idna-2.6.dist-info
libnacl
libnacl-1.6.1.dist-info
libopenzwave.cpython-35m-arm-linux-gnueabihf.so
magic.py
multidict
multidict-3.3.2.dist-info
multidict-4.0.0.dist-info
mutagen
mutagen-1.38.dist-info
mutagen-1.39.dist-info
mutagen-1.40.0.dist-info
openzwave
paho
paho_mqtt-1.3.1.dist-info
pigpio-1.35.dist-info
pigpio.py
pkg_resources
plexapi
PlexAPI-2.0.2.dist-info
PlexAPI-3.0.3.dist-info
PlexAPI-3.0.5.dist-info
psutil
psutil-5.4.1.dist-info
psutil-5.4.2.dist-info
psutil-5.4.3.dist-info
pushbullet
pushbullet.py-0.11.0.dist-info
pwmled
pwmled-1.2.1.dist-info
__pycache__
pydispatch
PyDispatcher-2.0.5.dist-info
pylgnetcast
pylgnetcast-0.2.0-py3.5.egg-info
pyowm
pyowm-2.7.1.dist-info
pyowm-2.8.0.dist-info
pyozwman
python_magic-0.4.13.dist-info
python_openzwave
python_openzwave-0.4.0.35.dist-info
python_openzwave-0.4.3.dist-info
python_vlc-1.1.2.dist-info
requests
requests-2.18.4.dist-info
RestrictedPython
RestrictedPython-4.0b2.dist-info
setuptools
setuptools-36.8.0.dist-info
six-1.11.0.dist-info
six.py
spidev-3.2.dist-info
spidev.cpython-35m-arm-linux-gnueabihf.so
sqlalchemy
SQLAlchemy-1.1.15.dist-info
SQLAlchemy-1.2.0.dist-info
SQLAlchemy-1.2.2.dist-info
tests
tqdm
tqdm-4.19.5.dist-info
typing-3.6.2.dist-info
typing.py
ua_parser
ua_parser-0.7.3.dist-info
urllib3
urllib3-1.22.dist-info
user_agents
user_agents-1.1.0.dist-info
vlc.py
wakeonlan-1.0.0.dist-info
wakeonlan.py
websocket
websocket_client-0.44.0.dist-info
websocket_client-0.46.0.dist-info
yarl
yarl-0.14.0.dist-info
yarl-0.18.0.dist-info
OttoWinter commented 6 years ago

Maybe related to #12455

doudz commented 6 years ago

You're right that's the same problem. I close this issue