Problems with a new installation


#1

Hi all

So… I had Mycroft up and running then a few days ago my system crashed (hard lockup). I had to restart it. Strangely Mycroft did start but was not listening (pavucontrol said that no application was recording sound). After searching a little bit on that I decided to try and re-install it… Did that 3 times already, on the last one I made sure to delete /opt/mycroft as well as my .mycroft folder in my home folder to have something clean.

All 3 times I had similar problems…
Starting Mycroft in debug mode the CLI first shows this kind of error:

16:39:12.806 - msm.mycroft_skills_manager - ERROR - Error running install_or_update on mycroft-fallback-duck-duck-go: PipRequirementsException(
Pip returned code 1:
Collecting duckduckgo2 (from -r /opt/mycroft/skills/mycroft-fallback-duck-duck-go.mycroftai/requirements.txt (line 1))
Using cached https://files.pythonhosted.org/packages/6c/2f/33c29da133061032843aed6630bdcda8456dbb5f6026e091ff6a3176c8e7/duckduckgo2-0.242.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-k8gpj5xd/duckduckgo2/setup.py", line 2, in <module>
from duckduckgo import __version__
File "/tmp/pip-install-k8gpj5xd/duckduckgo2/duckduckgo.py", line 2, in <module>
import urllib2
ModuleNotFoundError: No module named 'urllib2'

--------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-k8gpj5xd/duckduckgo2/
)
16:39:12.879 - msm.skill_entry - INFO - Successfully installed mycroft-configuration
16:39:13.006 - msm.skill_entry - INFO - Successfully installed mycroft-npr-news
16:39:13.389 - msm.skill_entry - INFO - Successfully installed mycroft-ip
16:39:13.541 - msm.skill_entry - INFO - Successfully installed mycroft-wiki
16:39:13.580 - msm.mycroft_skills_manager - ERROR - Error running install_or_update on mycroft-weather: PipRequirementsException(
Pip returned code 1:
Collecting multi-key-dict==2.0.3 (from -r /opt/mycroft/skills/mycroft-weather.mycroftai/requirements.txt (line 1))
Collecting pyowm==2.6.1 (from -r /opt/mycroft/skills/mycroft-weather.mycroftai/requirements.txt (line 2))
Requirement already satisfied: requests==2.13.0 in ./.venv/lib/python3.6/site-packages (from -r /opt/mycroft/skills/mycroft-weather.mycroftai/requirements.txt (line 3)) (2.13.0)

~~~~ll packages due to an EnvironmentError: [Errno 2] Aucun fichier ou dossier de ce type: '/home/seb/mycroft-core/.venv/lib/python3.6/site-packages/netifaces-0.10.7.dist-info/METADATA'
)
16:39:13.593 - msm.mycroft_skills_manager - ERROR - Error running install_or_update on mycroft-alarm: PipRequirementsException(
Pip returned code 1:
Collecting arrow==0.12.0 (from -r /opt/mycroft/skills/mycroft-alarm.mycroftai/requirements.txt (line 1))
~~~~ment already satisfied: python-dateutil in ./.venv/lib/python3.6/site-packages (from arrow==0.12.0->-r /opt/mycroft/skills/mycroft-alarm.mycroftai/requirements.txt (line 1)) (2.6.0)
Collecting backports.functools-lru-cache==1.2.1 (from arrow==0.12.0->-r /opt/mycroft/skills/mycroft-alarm.mycroftai/requirements.txt (line 1))
Using cached https://files.pythonhosted.org/packages/d1/0e/c473e3c37c34fea699d85d5b9e3caf712813c4cd2dcc0a5a64ec2a6867f7/backports.functools_lru_cache-1.2.1-py2.py3-none-any.whl
~~~~y satisfied: six>=1.5 in ./.venv/lib/python3.6/site-packages (from python-dateutil->arrow==0.12.0->-r /opt/mycroft/skills/mycroft-alarm.mycroftai/requirements.txt (line 1)) (1.10.0)

~~~~ll packages due to an EnvironmentError: [Errno 2] Aucun fichier ou dossier de ce type: '/home/seb/mycroft-core/.venv/lib/python3.6/site-packages/netifaces-0.10.7.dist-info/METADATA'
)

And then I have multiple occurrences of this, mentioning different Python dependencies:

16:39:31.118 - mycroft.skills.core:load_skill:105 - INFO - ATTEMPTING TO LOAD SKILL: mycroft-date-time.mycroftai with ID -1046588894825522079
16:39:31.124 - mycroft.skills.core:load_skill:144 - ERROR - Failed to load skill: mycroft-date-time.mycroftai
Traceback (most recent call last):
File "/home/seb/mycroft-core/mycroft/skills/core.py", line 115, in load_skill
('.py', 'rb', imp.PY_SOURCE)
File "/usr/lib64/python3.6/imp.py", line 235, in load_module
return load_source(name, filename, file)
File "/usr/lib64/python3.6/imp.py", line 172, in load_source
module = _load(spec)
File "<frozen importlib._bootstrap>", line 684, in _load
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/opt/mycroft/skills/mycroft-date-time.mycroftai/__init__.py", line 16, in <module>
import tzlocal
ModuleNotFoundError: No module named 'tzlocal'

On my second try Mycroft was listening - I got it to do simple tasks like telling its version - but now it won’t even pair anymore.

I have no idea what to do next… Suggestions?

This is on OpenSUSE 15.0 and I installed using git.
Python 3.6.5


#2

I might be wrong on this but I think python 3.4+ support is only being released today with the 18.2.6b version. This could be the source of your issues.


#3

Mycroft was working before on the same system…
I do have Python 2.7 installed in parallel but the errors mention 3.6’s libraries…


#4

OK I’d wait on this until 18.2.6b release drops which should be later today, we’re upgrading mycroft-core to Python 3.x


#5

Ok thanks, I can wait one more day no big deal :slight_smile:
I’ll try to install again tomorrow, see what happens.


#6

@KathyReid,
Does the upgrade in Python require a platform re-install or can we just "sudo apt-get dist-upgrade?


#7

The Python change shouldn’t require a re-install; it should just require updating to 18.2.6b of mycroft-core, which should happen automatically for Picroft and Mark 1 Devices. If you’re running on Linux you may need to do a git pull origin master wherever your mycroft-core is installed then run update_dev.sh.


#8

I’ve just updated my installation using @Wolfgange’s instructions from another topic (the one about switching from Python 2.7 to 3.4+). I am on the dev branch for now.
Mycroft starts, I still have a few errors about 2-3 skills, but it answers to me (I haven’t installed any additional skills at this point). However…

 what is your version?                                                                        DEBUG output                                                                              
 >> I am running mycroft-core version 18.2.5 beta.

Does this mean that 18.2.6b hasn’t been released yet?

Also, the skill I use the most is the Home Assistant skill… Any chance of getting that to work at the moment?

Thanks :slight_smile:


#9

I’m guessing the new version hasn’t been released yet?
Just to confirm…
I’ve tried updating and even re-installing from the master branch and Mycroft still says it’s running 18.2.5b (and it doesn’t know any skill named “home assistant” anymore btw).


#10

New release hasn’t dropped yet, no


#11

Ok I’ll try again tomorrow, and the day after that… Until it updates :wink:


#12

Ok, let’s forget about the new version for a moment… The current one, installed from the master branch, runs on Python 2.7 right? And the existing skills should all work with it…

Right now when I start Mycroft it’s complaining about a number of modules, which I’ve tried to install but couldn’t get them all, and the one I need to fix ASAP is this one:

13:19:33.522 - mycroft.skills.core:load_skill:106 - INFO - ATTEMPTING TO LOAD SKILL: HomeAssistantSkill with ID -3331809641323970491
13:19:33.529 - mycroft.skills.core:load_skill:143 - ERROR - Failed to load skill: HomeAssistantSkill
Traceback (most recent call last):
File "/home/seb/mycroft-core/mycroft/skills/core.py", line 111, in load_skill
skill_descriptor["name"] + MainModule, *skill_descriptor["info"])
File "/opt/mycroft/skills/HomeAssistantSkill/__init__.py", line 10, in <module>
from fuzzywuzzy import fuzz
ImportError: No module named fuzzywuzzy

If some of the other features don’t work it’s ok, but I need this one.
Problem is…

seb@linux-8jgi:~/mycroft-core> pip install fuzzywuzzy --user
Requirement already satisfied: fuzzywuzzy in /home/seb/.local/lib/python3.6/site-packages (0.16.0)

It’s already installed BUT it is in the Python 3.6 libs folder… I thought pip would work for Python 2.7 and pip3 for Python 3.x… So how do I force it to install this module for Python 2.7?

Thanks.


#13

I think I’m making progress… I was missing the python-pip2 package. As soon as I installed it…

seb@linux-8jgi:~/mycroft-core> pip2 install fuzzywuzzy --user
Collecting fuzzywuzzy
  Using cached https://files.pythonhosted.org/packages/3b/36/be990a35c7e8ed9dc176c43b5699cd971cec0b6f9ef858843374171df4f2/fuzzywuzzy-0.16.0-py2.py3-none-any.whl
Installing collected packages: fuzzywuzzy
Successfully installed fuzzywuzzy-0.16.0

Now let’s try with the other modules and hopefully I can get Mycroft to run properly again.


#14

Mycroft runs in it’s own virtual environment (which is created when you run dev_setup.sh) which means it can’t access the modules you install in your system. This is to make sure that the mycroft-install doesn’t mess with any of the modules of the system.

to install in the mycroft virtualenv you need to activate it first by running

workon mycroft

(or if that fails source ~/.virtualenvs/mycroft/bin/activate)

Then you can do the pip install:

pip install fuzzywuzzy


#15

… And Mycroft is still complaining about numerous modules that I have just installed…


#16

I’ve just seen your reply @forslund thanks for the reminder!
Let me try that


#17

Nope…

seb@linux-8jgi:~/mycroft-core> /home/seb/.virtualenvs/mycroft/bin/activate
seb@linux-8jgi:~/mycroft-core> pip2 install fuzzywuzzy --user
Requirement already satisfied: fuzzywuzzy in /home/seb/.local/lib/python2.7/site-packages (0.16.0)
seb@linux-8jgi:~/mycroft-core> pip2 install pytz --user
Requirement already satisfied: pytz in /home/seb/.local/lib/python2.7/site-packages (2018.4)

#18

When you try to invoke activate it should be source /home/seb/.virtualenvs/mycroft/bin/activate (might depend on your shell)

You can use which to verify that the venv is properly activated:

ake@Woodstock:~$ which pip
/usr/bin/pip
ake@Woodstock:~$ workon mycroft
(mycroft) ake@Woodstock:~$ which pip
/home/ake/.virtualenvs/mycroft/bin/pip
(mycroft) ake@Woodstock:~$ 

If the activation script doesn’t work I suggest you delete the virtualenv (rm -rf ~/.virtualenvs/mycroft) and rerun the dev_setup.sh script.


#19

I’ve done a new installation, deleting both my .virtualenvs folder (this machine only runs Mycroft so this won’t affect other Python programs) and /opt/mycroft.
Now everything works except for duckduckgo and Home Assistant… Let me try what you just said and we’ll see.


#20

Ok, installing the modules seemed to work, this is different now…

/home/seb/.virtualenvs/mycroft/lib/python2.7/site-packages/fuzzywuzzy/fuzz.py:35: UserWarning: Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning
warnings.warn('Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning')
14:59:01.647 - mycroft.skills.core:load_skill:143 - ERROR - Failed to load skill: HomeAssistantSkill
Traceback (most recent call last):
File "/home/seb/mycroft-core/mycroft/skills/core.py", line 115, in load_skill
skill = skill_module.create_skill()
File "/opt/mycroft/skills/HomeAssistantSkill/__init__.py", line 598, in create_skill
return HomeAssistantSkill()
File "/opt/mycroft/skills/HomeAssistantSkill/__init__.py", line 166, in __init__
self._setup()
File "/opt/mycroft/skills/HomeAssistantSkill/__init__.py", line 177, in _setup
portnumber = int(portnumber)
TypeError: int() argument must be a string or a number, not 'NoneType'

Let me see if I can find python-Levenshtein and then I think I’ll be good to go…