SlapBot / stephanie-va

Stephanie is an open-source platform built specifically for voice-controlled applications as well as to automate daily tasks imitating much of an virtual assistant's work.
https://slapbot.github.io/
MIT License
799 stars 127 forks source link

importlib errors when calling util #15

Closed JoshkVFX closed 7 years ago

JoshkVFX commented 7 years ago

importlib.util causes an error during this command: python install.py

The traceback is this: Setting up... Please wait... Traceback (most recent call last): File "install.py", line 60, in <module> i.set_up() File "install.py", line 29, in set_up status = self.check_if_installed(module) File "install.py", line 49, in check_if_installed module_status = importlib.util.find_spec(module_name) AttributeError: 'module' object has no attribute 'util'

Here's a good stackoverflow on the issue.

SlapBot commented 7 years ago

Hmm, I wonder why I am not able to reproduce this error, looking at the stackoverflow, replacing import importlib to import importlib.util fixes the issue.

Since I can't reproduce try these methods, and let's see which of them works:

  1. replace import importlib to import importlib.util
  2. Add from importlib import util along with import importlib and then change the call in line 49 from module_status = importlib.util.find_spec(module_name) to this module_status = util.find_spec(module_name)
  3. Lastly, try replacing import importlib to from importlib import util and then change the call in line 49 from module_status = importlib.util.find_spec(module_name) to this module_status = util.find_spec(module_name)
Nesh108 commented 7 years ago

I had the same problem and I think it wasn't related to importlib at all. I was missing some libraries (maybe portaudio19-dev).

@JoshKellyVFX could you try running pip install -r requirements.txt? I think that would tell us more.

JoshkVFX commented 7 years ago

@Nesh108 I've run the requirements.txt and even got a fresh clone of the repository and same issue.

@SlapBot I'll test those shotly

SlapBot commented 7 years ago

@JoshKellyVFX Any results so far?

SlapBot commented 7 years ago

Closing it for expiry period.

danewatts commented 7 years ago

Hey, I'm having this issue. I tried the changes above but none of them worked. I am not a python programmer. Any help?

SlapBot commented 7 years ago

Which os you're using? and the python and pip version? finally write the error statement.

danewatts commented 7 years ago

Ubuntu 16.04.2 LTS Python 2.7.12

stephanie-va master ❯ python install.py                                     ✱ ◼
Setting up... Please wait...
Traceback (most recent call last):
  File "install.py", line 60, in <module>
    i.set_up()
  File "install.py", line 29, in set_up
    status = self.check_if_installed(module)
  File "install.py", line 49, in check_if_installed
    module_status = importlib.util.find_spec(module_name)
AttributeError: 'module' object has no attribute 'util'

I have got this working for Python3 with no issues. But the above is for reference.

SlapBot commented 7 years ago

Actually Stephanie isn't supported to python 2.x versions.