Error when starting appdaemon

Hello all,

I am receiving the following error when starting:

/usr/local/lib/python3.4/dist-packages/requests/init.py:80: RequestsDependencyWarning: urllib3 (1.22) or chardet (2.3.0) doesn’t match a supported version!
RequestsDependencyWarning)
2017-09-20 20:53:36.056474 INFO AppDaemon Version 2.1.9 starting
2017-09-20 20:53:36.057038 INFO Configuration read from: /home/homeassistant/conf/appdaemon.yaml
2017-09-20 20:53:36.169700 INFO Starting Apps
2017-09-20 20:53:36.267244 INFO Got initial state
2017-09-20 20:53:36.268924 INFO Loading Module: /home/homeassistant/conf/apps/hello.py
2017-09-20 20:53:36.270637 INFO Loading Object hello_world using class HelloWorld from module hello
2017-09-20 20:53:36.407425 INFO hello_world: Hello from AppDaemon
2017-09-20 20:53:36.410361 INFO hello_world: You are now ready to run Apps!
2017-09-20 20:53:36.410905 INFO Loading Module: /home/homeassistant/conf/apps/._hello.py
2017-09-20 20:53:36.411341 WARNING ------------------------------------------------------------
2017-09-20 20:53:36.411728 WARNING Unexpected error during loading of ._hello.py:
2017-09-20 20:53:36.412090 WARNING ------------------------------------------------------------
2017-09-20 20:53:36.413306 WARNING Traceback (most recent call last):
File “/usr/local/lib/python3.4/dist-packages/appdaemon/appdaemon.py”, line 900, in read_app
conf.modules[module_name] = importlib.import_module(module_name)
File “/usr/lib/python3.4/importlib/init.py”, line 104, in import_module
raise TypeError(msg.format(name))
TypeError: the ‘package’ argument is required to perform a relative import for ‘._hello’

2017-09-20 20:53:36.413977 WARNING ------------------------------------------------------------
2017-09-20 20:53:36.414403 INFO App initialization complete
2017-09-20 20:53:36.415077 INFO Dashboards are disabled
2017-09-20 20:53:36.415440 INFO API is disabled
2017-09-20 20:53:36.428303 INFO Connected to Home Assistant 0.53.1

Running it on a raspbian jessie. Thank you

It looks like your appdaemon.yaml is trying to reference a file called ._hello.py and I suspect it doesn’t like filenames starting with .

1 Like

seems to me that urllib3 or chardet are not up to date.

you could try to update those.

1 Like

@ReneTode I’ve tried running the pip install urllib3 again but said it already has been satisfied.

what are the versions from urllib3 and chardet?

1 Like

Unfortunately I do not know how to check that.

@ReneTode After further research I believe this is what you’ve asked

pip show urllib3

Name: urllib3
Version: 1.9.1
Location: /usr/lib/python2.7/dist-packages
Requires:
pi@raspberrypi:~ $ pip show chardet

Name: chardet
Version: 2.3.0
Location: /usr/lib/python2.7/dist-packages
Requires:
pi@raspberrypi:~ $

you need to do pip3.

and i hope you used pip3 to install appdaemon.
it seems that your pip points to python 2.7 and not to python 3.4 or up

1 Like

I used sudo pip3 install appdaemon

I also just ran

pip3 install urllib3
Requirement already satisfied (use --upgrade to upgrade): urllib3 in /usr/local/lib/python3.4/dist-packages
Cleaning up…

@chench0 try… pip3 install --ignore-installed urllib3

1 Like

then you need pip3 show to check the versions :wink:

1 Like

So the ignore command above worked but still receiving an error.
Here’s the output (sorry for the formatting. Typing on a phone)
pi@raspberrypi:~ $ pip3 show urllib3

Name: urllib3
Version: 1.22
Location: /usr/local/lib/python3.4/dist-packages
Requires:
pi@raspberrypi:~ $ appdaemon -c /home/homeassistant/conf
/usr/local/lib/python3.4/dist-packages/requests/init.py:80: RequestsDependencyWarning: urllib3 (1.22) or chardet (2.3.0) doesn’t match a supported version!
RequestsDependencyWarning)
2017-09-21 13:06:24.289750 INFO AppDaemon Version 2.1.9 starting
2017-09-21 13:06:24.290262 INFO Configuration read from: /home/homeassistant/conf/appdaemon.yaml
2017-09-21 13:06:24.428211 INFO Starting Apps
2017-09-21 13:06:24.526202 INFO Got initial state
2017-09-21 13:06:24.527708 INFO Loading Module: /home/homeassistant/conf/apps/hello.py
2017-09-21 13:06:24.530591 INFO Loading Object hello_world using class HelloWorld from module hello
2017-09-21 13:06:24.682003 INFO hello_world: Hello from AppDaemon
2017-09-21 13:06:24.684968 INFO hello_world: You are now ready to run Apps!
2017-09-21 13:06:24.685417 INFO Loading Module: /home/homeassistant/conf/apps/._hello.py
2017-09-21 13:06:24.685799 WARNING ------------------------------------------------------------
2017-09-21 13:06:24.686110 WARNING Unexpected error during loading of ._hello.py:
2017-09-21 13:06:24.686540 WARNING ------------------------------------------------------------
2017-09-21 13:06:24.689494 WARNING Traceback (most recent call last):
File “/usr/local/lib/python3.4/dist-packages/appdaemon/appdaemon.py”, line 900, in read_app
conf.modules[module_name] = importlib.import_module(module_name)
File “/usr/lib/python3.4/importlib/init.py”, line 104, in import_module
raise TypeError(msg.format(name))
TypeError: the ‘package’ argument is required to perform a relative import for ‘._hello’

2017-09-21 13:06:24.689940 WARNING ------------------------------------------------------------
2017-09-21 13:06:24.690329 INFO App initialization complete
2017-09-21 13:06:24.691121 INFO Starting dashboard
2017-09-21 13:06:24.699895 WARNING ------------------------------------------------------------
2017-09-21 13:06:24.700320 WARNING Unexpected error in dashboard thread
2017-09-21 13:06:24.700636 WARNING ------------------------------------------------------------
2017-09-21 13:06:24.715856 WARNING Traceback (most recent call last):
File “/usr/local/lib/python3.4/dist-packages/aiohttp/web_urldispatcher.py”, line 399, in init
directory = directory.resolve()
File “/usr/lib/python3.4/pathlib.py”, line 1031, in resolve
s = self._flavour.resolve(self)
File “/usr/lib/python3.4/pathlib.py”, line 297, in resolve
return _resolve(base, str(path)) or sep
File “/usr/lib/python3.4/pathlib.py”, line 282, in _resolve
target = accessor.readlink(newpath)
File “/usr/lib/python3.4/pathlib.py”, line 374, in readlink
return os.readlink(path)
FileNotFoundError: [Errno 2] No such file or directory: ‘/home/homeassistant/conf/compiled’

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File “/usr/local/lib/python3.4/dist-packages/appdaemon/rundash.py”, line 318, in run_dash
setup_routes(conf.dashboard_obj)
File “/usr/local/lib/python3.4/dist-packages/appdaemon/rundash.py”, line 288, in setup_routes
app.router.add_static(’/compiled_javascript’, dashboard.compiled_javascript_dir)
File “/usr/local/lib/python3.4/dist-packages/aiohttp/web_urldispatcher.py”, line 845, in add_static
follow_symlinks=follow_symlinks)
File “/usr/local/lib/python3.4/dist-packages/aiohttp/web_urldispatcher.py”, line 404, in init
“No directory exists at ‘{}’”.format(directory)) from error
ValueError: No directory exists at ‘/home/homeassistant/conf/compiled/javascript’

2017-09-21 13:06:24.716597 WARNING ------------------------------------------------------------
2017-09-21 13:06:24.717006 INFO API is disabled
2017-09-21 13:06:24.726959 INFO Connected to Home Assistant 0.53.1
^C2017-09-21 13:06:53.021677 INFO Keyboard interrupt
2017-09-21 13:06:53.029618 INFO Disconnecting from Home Assistant
2017-09-21 13:06:54.005831 INFO AppDeamon Exited
Task exception was never retrieved
future: <Task finished coro=<appstate_loop() done, defined at /usr/local/lib/python3.4/dist-packages/appdaemon/appdaemon.py:1108> exception=AttributeError("‘Queue’ object has no attribute ‘task_done’",)>
Traceback (most recent call last):
File “/usr/lib/python3.4/asyncio/tasks.py”, line 235, in _step
result = coro.send(value)
File “/usr/local/lib/python3.4/dist-packages/appdaemon/appdaemon.py”, line 1113, in appstate_loop
conf.appq.task_done()
AttributeError: ‘Queue’ object has no attribute ‘task_done’

try

pip3 install --ignore-installed chardet

1 Like

@ReneTode So I think I made some progress. Now I only receive one error:

appdaemon -c /home/homeassistant/conf
2017-09-21 17:38:36.697801 INFO AppDaemon Version 2.1.9 starting
2017-09-21 17:38:36.698315 INFO Configuration read from: /home/homeassistant/conf/appdaemon.yaml
2017-09-21 21:38:36.807808 INFO Starting Apps
2017-09-21 21:38:36.900639 INFO Got initial state
2017-09-21 21:38:36.902127 INFO Loading Module: /home/homeassistant/conf/apps/hello.py
2017-09-21 21:38:36.903715 INFO Loading Object hello_world using class HelloWorld from module hello
2017-09-21 21:38:37.065819 INFO hello_world: Hello from AppDaemon
2017-09-21 21:38:37.068527 INFO hello_world: You are now ready to run Apps!
2017-09-21 21:38:37.068942 INFO Loading Module: /home/homeassistant/conf/apps/._hello.py
2017-09-21 21:38:37.069258 WARNING ------------------------------------------------------------
2017-09-21 21:38:37.069498 WARNING Unexpected error during loading of ._hello.py:
2017-09-21 21:38:37.069727 WARNING ------------------------------------------------------------
2017-09-21 21:38:37.070889 WARNING Traceback (most recent call last):
File “/usr/local/lib/python3.4/dist-packages/appdaemon/appdaemon.py”, line 900, in read_app
conf.modules[module_name] = importlib.import_module(module_name)
File “/usr/lib/python3.4/importlib/init.py”, line 104, in import_module
raise TypeError(msg.format(name))
TypeError: the ‘package’ argument is required to perform a relative import for ‘._hello’

2017-09-21 21:38:37.071302 WARNING ------------------------------------------------------------
2017-09-21 21:38:37.071595 INFO App initialization complete
2017-09-21 21:38:37.072179 INFO Dashboards are disabled
2017-09-21 21:38:37.072476 INFO API is disabled
2017-09-21 21:38:37.082554 INFO Connected to Home Assistant 0.53.1

for that error i have no clue. maybe that @aimc has an idea about this

1 Like

@ReneTode So after updating chardet like you suggested above most of the errors disappeared so I decided to recreate the file hello.py as suggested by @gpbenton. It’s running perfectly now :slight_smile:

Thanks a bunch guys! Really appreciate it!

2 Likes