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
70.17k stars 29.2k forks source link

logbook & automation not loading on v0.9.1 #768

Closed RickB17 closed 8 years ago

RickB17 commented 8 years ago

This may be all related, but I'm not sure:

1) The logbook will not load because sqlite is not found. Isn't this part of the Python 3 standard libs? 2) Automation component is unable to be found.

uname -a
Linux raspberrypi 3.18.7-v7+ #755 SMP PREEMPT Thu Feb 12 17:20:48 GMT 2015 armv7l GNU/Linux

HA LOG ENTRIES FOR ERRORS

15-12-17 04:35:51 homeassistant.loader: Error loading homeassistant.components.automation. Make sure all dependencies are installed
Traceback (most recent call last):
  File "/home/USER/env/lib/python3.4/site-packages/homeassistant/loader.py", line 115, in get_component
    module = importlib.import_module(path)
  File "/usr/local/lib/python3.4/importlib/__init__.py", line 109, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
  File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1471, in exec_module
  File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
  File "/home/USER/env/lib/python3.4/site-packages/homeassistant/components/automation/__init__.py", line 14, in <module>
    from homeassistant.components import logbook
  File "/home/USER/env/lib/python3.4/site-packages/homeassistant/components/logbook.py", line 19, in <module>
    from homeassistant.components import recorder, sun
  File "/home/USER/env/lib/python3.4/site-packages/homeassistant/components/recorder.py", line 13, in <module>
    import sqlite3
  File "/usr/local/lib/python3.4/sqlite3/__init__.py", line 23, in <module>
    from sqlite3.dbapi2 import *
  File "/usr/local/lib/python3.4/sqlite3/dbapi2.py", line 27, in <module>
    from _sqlite3 import *
ImportError: No module named '_sqlite3'
15-12-17 04:35:51 homeassistant.loader: Unable to find component automation
15-12-17 04:35:51 homeassistant.loader: Error loading homeassistant.components.logbook. Make sure all dependencies are installed
Traceback (most recent call last):
  File "/home/USER/env/lib/python3.4/site-packages/homeassistant/loader.py", line 115, in get_component
    module = importlib.import_module(path)
  File "/usr/local/lib/python3.4/importlib/__init__.py", line 109, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
  File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1471, in exec_module
  File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
  File "/home/USER/env/lib/python3.4/site-packages/homeassistant/components/logbook.py", line 19, in <module>
    from homeassistant.components import recorder, sun
  File "/home/USER/env/lib/python3.4/site-packages/homeassistant/components/recorder.py", line 13, in <module>
    import sqlite3
  File "/usr/local/lib/python3.4/sqlite3/__init__.py", line 23, in <module>
    from sqlite3.dbapi2 import *
  File "/usr/local/lib/python3.4/sqlite3/dbapi2.py", line 27, in <module>
    from _sqlite3 import *
ImportError: No module named '_sqlite3'
15-12-17 04:35:51 homeassistant.loader: Unable to find component logbook
15-12-17 04:35:51 homeassistant.loader: Error loading homeassistant.components.history. Make sure all dependencies are installed
Traceback (most recent call last):
  File "/home/USER/env/lib/python3.4/site-packages/homeassistant/loader.py", line 115, in get_component
    module = importlib.import_module(path)
  File "/usr/local/lib/python3.4/importlib/__init__.py", line 109, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
  File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
  File "<frozen importlib._bootstrap>", line 2226, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 1200, in _load_unlocked
  File "<frozen importlib._bootstrap>", line 1129, in _exec
  File "<frozen importlib._bootstrap>", line 1471, in exec_module
  File "<frozen importlib._bootstrap>", line 321, in _call_with_frames_removed
  File "/home/USER/env/lib/python3.4/site-packages/homeassistant/components/history.py", line 15, in <module>
    import homeassistant.components.recorder as recorder
  File "/home/USER/env/lib/python3.4/site-packages/homeassistant/components/recorder.py", line 13, in <module>
    import sqlite3
  File "/usr/local/lib/python3.4/sqlite3/__init__.py", line 23, in <module>
    from sqlite3.dbapi2 import *
  File "/usr/local/lib/python3.4/sqlite3/dbapi2.py", line 27, in <module>
    from _sqlite3 import *
ImportError: No module named '_sqlite3'
15-12-17 04:35:51 homeassistant.loader: Unable to find component history
Landrash commented 8 years ago

What dist are you running on the rPi? sqlite3 should be included in the standard install of Python 3.4.

Have you verified that the the files are present in the directory for you python installation? If there not you could have a corrupt package.

Assuming it's a problem with the python package on your dist you can reinstall the package with
Ubuntu/Debian

sudo apt-get install --reinstall package PACKAGE_NAME
RickB17 commented 8 years ago

I installed sqlite3, but the issue persists.

sudo apt-get install sqlite3
$ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 7 (wheezy)"
NAME="Raspbian GNU/Linux"
VERSION_ID="7"
VERSION="7 (wheezy)"
ID=raspbian
ID_LIKE=debian
ANSI_COLOR="1;31"
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
:/usr/local/lib/python3.4$ ls
abc.py               crypt.py            html             optparse.py        shelve.py          this.py
aifc.py              csv.py              http             os.py              shlex.py           _threading_local.py
antigravity.py       ctypes              idlelib          _osx_support.py    shutil.py          threading.py
argparse.py          curses              imaplib.py       pathlib.py         _sitebuiltins.py   timeit.py
ast.py               datetime.py         imghdr.py        pdb.py             site-packages      tkinter
asynchat.py          dbm                 importlib        __phello__.foo.py  site.py            tokenize.py
asyncio              decimal.py          imp.py           pickle.py          smtpd.py           token.py
asyncore.py          difflib.py          inspect.py       pickletools.py     smtplib.py         traceback.py
base64.py            dis.py              io.py            pipes.py           sndhdr.py          tracemalloc.py
bdb.py               distutils           ipaddress.py     pkgutil.py         socket.py          trace.py
binhex.py            doctest.py          json             platform.py        socketserver.py    tty.py
bisect.py            dummy_threading.py  keyword.py       plat-linux         sqlite3            turtledemo
_bootlocale.py       _dummy_thread.py    lib2to3          plistlib.py        sre_compile.py     turtle.py
bz2.py               email               lib-dynload      poplib.py          sre_constants.py   types.py
calendar.py          encodings           LICENSE.txt      posixpath.py       sre_parse.py       unittest
cgi.py               ensurepip           linecache.py     pprint.py          ssl.py             urllib
cgitb.py             enum.py             locale.py        profile.py         statistics.py      uuid.py
chunk.py             filecmp.py          logging          pstats.py          stat.py            uu.py
cmd.py               fileinput.py        lzma.py          pty.py             stringprep.py      venv
codecs.py            fnmatch.py          macpath.py       __pycache__        string.py          warnings.py
codeop.py            formatter.py        macurl2path.py   pyclbr.py          _strptime.py       wave.py
code.py              fractions.py        mailbox.py       py_compile.py      struct.py          weakref.py
collections          ftplib.py           mailcap.py       pydoc_data         subprocess.py      _weakrefset.py
_collections_abc.py  functools.py        _markupbase.py   pydoc.py           sunau.py           webbrowser.py
colorsys.py          __future__.py       mimetypes.py     _pyio.py           symbol.py          wsgiref
_compat_pickle.py    genericpath.py      modulefinder.py  queue.py           symtable.py        xdrlib.py
compileall.py        getopt.py           multiprocessing  quopri.py          _sysconfigdata.py  xml
concurrent           getpass.py          netrc.py         random.py          sysconfig.py       xmlrpc
config-3.4m          gettext.py          nntplib.py       reprlib.py         tabnanny.py        zipfile.py
configparser.py      glob.py             ntpath.py        re.py              tarfile.py
contextlib.py        gzip.py             nturl2path.py    rlcompleter.py     telnetlib.py
copy.py              hashlib.py          numbers.py       runpy.py           tempfile.py
copyreg.py           heapq.py            opcode.py        sched.py           test
cProfile.py          hmac.py             operator.py      selectors.py       textwrap.py

I did a reinstall with of python3.4

make install

Issue still persists.

balloob commented 8 years ago

If you're running Wheezy, it means you compiled Python 3 yourself. You must have missed installing the right dependencies before compiling Python 3. It's easier to upgrade to the latest Raspbian which is Jessie based and comes with Python 3.4

On Thu, Dec 17, 2015 at 5:07 PM, Rick Breidenstein <notifications@github.com

wrote:

$ cat /etc/os-release PRETTY_NAME="Raspbian GNU/Linux 7 (wheezy)" NAME="Raspbian GNU/Linux" VERSION_ID="7" VERSION="7 (wheezy)" ID=raspbian ID_LIKE=debian ANSI_COLOR="1;31" HOME_URL="http://www.raspbian.org/" SUPPORT_URL="http://www.raspbian.org/RaspbianForums" BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"

— Reply to this email directly or view it on GitHub https://github.com/balloob/home-assistant/issues/768#issuecomment-165629080 .

PaulusSchoutsen.nl It's nice to be important but it's more important to be nice.

RickB17 commented 8 years ago

Thanks I'll give that a go.

RickB17 commented 8 years ago

I'll mark this as closed and re-open if the issue persists after the upgrade.