[solved] ModuleNotFoundError ‘xxhash._xxhash’ when starting Mycroft

When I start MyCroft on my Raspberry Pi 4 running Raspbian it seems to start alright but it can’t hear me, so I tried running it with debug and audiotest ammeneded it the end, but it spits out an error.

pi@raspberrypi:~/mycroft-core $ ./start-mycroft.sh debug
Already up to date.
Starting all mycroft-core services
Initializing…
Starting background service bus
CAUTION: The Mycroft bus is an open websocket with no built-in security
measures. You are responsible for protecting the local port
8181 with a firewall as appropriate.
Starting background service skills
Starting background service audio
Starting background service voice
Starting background service enclosure
Starting cli
Traceback (most recent call last):
File “/usr/lib/python3.7/runpy.py”, line 183, in _run_module_as_main
mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File “/usr/lib/python3.7/runpy.py”, line 109, in _get_module_details
import (pkg_name)
File “/home/pi/mycroft-core/mycroft/ init .py”, line 17, in
from mycroft.api import Api
File “/home/pi/mycroft-core/mycroft/api/ init .py”, line 22, in
from mycroft.configuration import Configuration
File “/home/pi/mycroft-core/mycroft/configuration/ init .py”, line 15, in
from .config import Configuration, LocalConf, RemoteConf
File “/home/pi/mycroft-core/mycroft/configuration/config.py”, line 23, in
from mycroft.util.json_helper import load_commented_json, merge_dict
File “/home/pi/mycroft-core/mycroft/util/ init .py”, line 24, in
from mycroft.util.format import nice_number
File “/home/pi/mycroft-core/mycroft/util/format.py”, line 38, in
from padatious.util import expand_parentheses
File “/home/pi/mycroft-core/.venv/lib/python3.7/site-packages/padatious/ init .py”, line 15, in
from .intent_container import IntentContainer
File “/home/pi/mycroft-core/.venv/lib/python3.7/site-packages/padatious/intent_container.py”, line 25, in
from padatious.entity import Entity
File “/home/pi/mycroft-core/.venv/lib/python3.7/site-packages/padatious/entity.py”, line 17, in
from padatious.simple_intent import SimpleIntent
File “/home/pi/mycroft-core/.venv/lib/python3.7/site-packages/padatious/simple_intent.py”, line 17, in
from padatious.id_manager import IdManager
File “/home/pi/mycroft-core/.venv/lib/python3.7/site-packages/padatious/id_manager.py”, line 17, in
from padatious.util import StrEnum
File “/home/pi/mycroft-core/.venv/lib/python3.7/site-packages/padatious/util.py”, line 15, in
from xxhash import xxh32
File “/home/pi/mycroft-core/.venv/lib/python3.7/site-packages/xxhash/ init .py”, line 1, in
from ._xxhash import (
ModuleNotFoundError: No module named ‘xxhash._xxhash’

I tried installing xxhash (pip install xxhash) but that hasn’t remedied the problem.

Any help and/or suggestions highly appreciated.

Before installing, start the virtual env (source ~/mycroft-core/.venv/bin/activate && pip install xxhash)?

Okay, thank you for answering! I’ve tried that but it hasn’t seemed to have worked.

Here’s everything I tried and the responses I got back:

https://paste.ubuntu.com/p/v8vmbNpTGM/

With the venv active, can you run python3 and try “import xxhash”?

Thank you but it still doesn’t seem to be working.

Here’s what I tried and what happened:
https://paste.ubuntu.com/p/wTqf6HwB6T/

I also tried a couple of things suggested to me on Reddit.

Something’s wrong with your installed xxhash, it seems. Try uninstalling it and reinstalling new?

within venv or just normal sudo?

within the ~/.venv , where you land in after login - you shouldn’t need sudo - the py env is in user home dir , right ?

1 Like

I tried uninstalling and reinstalling xxhash and here’s the outputs:

https://paste.ubuntu.com/p/bJyJ8G9Y6Y/

I followed the Linux guide and to active the .venv I use (source ~/mycroft-core/.venv/bin/activate) so yeah.

Could you please run the following commands and paste us the ouput?

$ source ~/mycroft-core/.venv/bin/activate
$ whereis python

It should return a list of paths and one of them should be /home/pi/mycroft-core/.venv/bin/python

If it’s the case then, try to run this:

$ /home/pi/mycroft-core/.venv/bin/python

Python 3.7.3 (default, Jul 25 2020, 13:03:44) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import xxhash
>>> xxhash.VERSION
'2.0.0'

Hi! Thank you for your response! Below you’ll find the outputs to everything you asked!

(.venv) pi@raspberrypi:~ $ source ~/mycroft-core/.venv/bin/activate
(.venv) pi@raspberrypi:~ $ where python
-bash: where: command not found
(.venv) pi@raspberrypi:~ $ $ where python
-bash: $: command not found
(.venv) pi@raspberrypi:~ $ $ where python
-bash: $: command not found
(.venv) pi@raspberrypi:~ $ where python
-bash: where: command not found
(.venv) pi@raspberrypi:~ $ python where
/usr/local/bin/python3.8: can't open file 'where': [Errno 2] No such file or directory
(.venv) pi@raspberrypi:~ $ whereis python
python: /usr/bin/python2.7 /usr/bin/python3.7m /usr/bin/python3.7-config /usr/bin/python /usr/bin/python3.7 /usr/bin/python2.7-config /usr/bin/python3.7m-config /usr/lib/python2.7 /usr/lib/python3.7 /etc/python2.7 /etc/python /etc/python3.7 /usr/local/bin/python3.8 /usr/local/bin/python3.8-config /usr/local/lib/python3.8 /usr/local/lib/python2.7 /usr/local/lib/python3.7 /usr/include/python2.7 /usr/include/python3.7m /usr/include/python3.7 /usr/share/python /home/pi/mycroft-core/.venv/bin/python /usr/share/man/man1/python.1.gz
(.venv) pi@raspberrypi:~ $ /home/pi/mycroft-core/.venv/bin/python
Python 3.7.3 (default, Jul 25 2020, 13:03:44)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import xxhash
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/pi/mycroft-core/.venv/lib/python3.7/site-packages/xxhash/__init__.py", line 1, in <module>
    from ._xxhash import (
ModuleNotFoundError: No module named 'xxhash._xxhash'
>>>
(.venv) pi@raspberrypi:~ $

Sorry about the whereis typo… Could you please do the same with pip ?

$ source /home/pi/mycroft-core/.venv/bin/activate
$ whereis pip

You should have a line like this /home/pi/mycroft-core/.venv/bin/pip , then try this:

$ /home/pi/mycroft-core/.venv/bin/pip install xxhash
$ /home/pi/mycroft-core/.venv/bin/python

Python 3.7.3 (default, Jul 25 2020, 13:03:44) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import xxhash
>>> xxhash.VERSION
'2.0.0'

Hahaha it’s okay, I at least worked out how to fix that!

(.venv) pi@raspberrypi:~ $ source /home/pi/mycroft-core/.venv/bin/activate
(.venv) pi@raspberrypi:~ $ whereis pip
pip: /etc/pip.conf /usr/local/bin/pip /usr/local/bin/pip3.7 /usr/local/bin/pip3.8 /home/pi/mycroft-core/.venv/bin/pip /home/pi/mycroft-core/.venv/bin/pip3.7 /home/pi/.local/bin/pip /home/pi/.local/bin/pip3.7 /usr/share/man/man1/pip.1.gz
(.venv) pi@raspberrypi:~ $ /home/pi/mycroft-core/.venv/bin/pip install xxhash
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: xxhash in ./mycroft-core/.venv/lib/python3.7/site-packages (2.0.0)
WARNING: You are using pip version 20.2.4; however, version 20.3.1 is available.
You should consider upgrading via the '/home/pi/mycroft-core/.venv/bin/python -m pip install --upgrade pip' command.
(.venv) pi@raspberrypi:~ $ ^C
(.venv) pi@raspberrypi:~ $ /home/pi/mycroft-core/.venv/bin/python -m pip install --upgrade pip'
>
> -bash: unexpected EOF while looking for matching `''
-bash: syntax error: unexpected end of file
(.venv) pi@raspberrypi:~ $ /home/pi/mycroft-core/.venv/bin/python -m pip install --upgrade pip
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Collecting pip
  Downloading pip-20.3.1-py2.py3-none-any.whl (1.5 MB)
     |████████████████████████████████| 1.5 MB 157 kB/s
Installing collected packages: pip
  Attempting uninstall: pip
    Found existing installation: pip 20.2.4
    Uninstalling pip-20.2.4:
      Successfully uninstalled pip-20.2.4
Successfully installed pip-20.3.1
(.venv) pi@raspberrypi:~ $ whereis pip
pip: /etc/pip.conf /usr/local/bin/pip /usr/local/bin/pip3.7 /usr/local/bin/pip3.8 /home/pi/mycroft-core/.venv/bin/pip /home/pi/mycroft-core/.venv/bin/pip3.7 /home/pi/.local/bin/pip /home/pi/.local/bin/pip3.7 /usr/share/man/man1/pip.1.gz
(.venv) pi@raspberrypi:~ $ /home/pi/mycroft-core/.venv/bin/pip install xxhash
Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple
Requirement already satisfied: xxhash in ./mycroft-core/.venv/lib/python3.7/site-packages (2.0.0)
(.venv) pi@raspberrypi:~ $ /home/pi/mycroft-core/.venv/bin/python
Python 3.7.3 (default, Jul 25 2020, 13:03:44)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import xxhash
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/pi/mycroft-core/.venv/lib/python3.7/site-packages/xxhash/__init__.py", line 1, in <module>
    from ._xxhash import (
ModuleNotFoundError: No module named 'xxhash._xxhash'
>>>
(.venv) pi@raspberrypi:~ $

This is insane, I never saw something like this… Try this:

$ /home/pi/mycroft-core/.venv/bin/python
Python 3.7.3 (default, Jul 25 2020, 13:03:44) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys   
>>> sys.executable
'/home/pi/mycroft-core/.venv/bin/python'
>>> sys.path
['', '/home/pi/mycroft-core', '/usr/lib/python37.zip', '/usr/lib/python3.7', '/usr/lib/python3.7/lib-dynload', '/home/pi/mycroft-core/.venv/lib/python3.7/site-packages']

This is truly a mixture of pain and humour at this point, but here you go:

(.venv) pi@raspberrypi:~ $ /home/pi/mycroft-core/.venv/bin/python
Python 3.7.3 (default, Jul 25 2020, 13:03:44)
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.executable
'/home/pi/mycroft-core/.venv/bin/python'
>>> sys.path
['', '/home/pi/mycroft-core', '/usr/lib/python37.zip', '/usr/lib/python3.7', '/usr/lib/python3.7/lib-dynload', '/home/pi/mycroft-core/.venv/lib/python3.7/site-packages']
>>>
>>>
(.venv) pi@raspberrypi:~ $

I’m starting to run out of ideas… Try this:

$ source /home/pi/mycroft-core/.venv/bin/activate
$ /home/pi/mycroft-core/.venv/bin/pip install --force-reinstall xxhash
$ /home/pi/mycroft-core/.venv/bin/python

Python 3.7.3 (default, Jul 25 2020, 13:03:44) 
[GCC 8.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import xxhash
>>> xxhash.VERSION
'2.0.0'
3 Likes

Okay WOW! That might have worked!

I’ll comment again if anything fails but it’s downloading skills right now!

Damn… Not an easy one!
:+1: :upside_down_face: :rofl: :joy: :crazy_face: :stuck_out_tongue_winking_eye: :ok_hand: :wave:

Thank you sooooo much!
It’s 1am where I am so I’ll probably try and set it all up and pair it in the morning!

I’m genuinely so grateful! Thank you! :smiley:

You are very welcome, please edit you post with [solved]. :+1: