openassistant / oa-core

Open Assistant Core
http://openassistant.org
GNU General Public License v3.0
293 stars 77 forks source link

Unable to start openassistant : Error loading sound: Parent module 'oa.modules' not loaded, cannot perform relative import #12

Closed analyticsUser closed 5 years ago

analyticsUser commented 5 years ago

Hi, I have followed all the steps described on github, but I am unable to start open-assistant. Following is the error:

[2019-04-16 16:11:24,762] INFO MainThread [main.py::94] Start Open Assistant [2019-04-16 16:11:24,762] INFO MainThread [main.py:init:18] Initializing Open Assistant [2019-04-16 16:11:24,762] DEBUG MainThread [agent.py:init:13] <main.OpenAssistant object at 0x7fd0bc6a3908> [2019-04-16 16:11:24,762] INFO MainThread [agent.py:_load_modules:33] Loading Modules <- /home/user/Music/oa-core/oa/modules [2019-04-16 16:11:24,762] INFO MainThread [util.py:load_module:60] sound <- /home/user/Music/oa-core/oa/modules/sound [2019-04-16 16:11:24,762] ERROR MainThread [agent.py:_load_modules:42] Error loading sound: Parent module 'oa.modules' not loaded, cannot perform relative import [2019-04-16 16:11:24,762] INFO MainThread [util.py:load_module:60] voice <- /home/user/Music/oa-core/oa/modules/voice [2019-04-16 16:11:24,762] ERROR MainThread [agent.py:_load_modules:42] Error loading voice: Parent module 'oa.modules' not loaded, cannot perform relative import [2019-04-16 16:11:24,762] INFO MainThread [util.py:load_module:60] speech_recognition <- /home/user/Music/oa-core/oa/modules/speech_recognition [2019-04-16 16:11:24,762] ERROR MainThread [agent.py:_load_modules:42] Error loading speech_recognition: Parent module 'oa.modules' not loaded, cannot perform relative import [2019-04-16 16:11:24,763] INFO MainThread [util.py:load_module:60] ear <- /home/user/Music/oa-core/oa/modules/ear [2019-04-16 16:11:24,763] ERROR MainThread [agent.py:_load_modules:42] Error loading ear: Parent module 'oa.modules' not loaded, cannot perform relative import [2019-04-16 16:11:24,763] INFO MainThread [util.py:load_module:60] mind <- /home/user/Music/oa-core/oa/modules/mind [2019-04-16 16:11:24,763] ERROR MainThread [agent.py:_load_modules:42] Error loading mind: Parent module 'oa.modules' not loaded, cannot perform relative import Traceback (most recent call last): File "/usr/lib/python3.5/runpy.py", line 184, in _run_module_as_main "main", mod_spec) File "/usr/lib/python3.5/runpy.py", line 85, in _run_code exec(code, run_globals) File "/home/user/Music/oa-core/oa/main.py", line 96, in start() File "/home/user/Music/oa-core/oa/main.py", line 44, in start a.parts['ear'].output += [a.parts.speech_recognition] File "/home/user/Music/oa-core/oa/core/util.py", line 89, in getitem return getattr(self, key) AttributeError: 'Core' object has no attribute 'ear'

Steps to reproduce the behavior:

  1. cd oa-core
  2. python3 -m oa
  3. Error as above

Desktop:

I am stuck on above step for too long. Kindly, help on the same.

joshuashort commented 5 years ago

Have you installed the python dependencies (pip3 install -r requirements.txt)?

analyticsUser commented 5 years ago

Yes, I followed the above steps and installed all dependencies as mentioned in README.md My Python version is 3.5 and I used pip version 19.x .

Is there some discrepancy in python version and pip version to be used ? Also, I ran command as pip install -r requirements.txt instead of using pip3.

Any kind of help is much appreciated to get me started with openassistant as I am still stuck at the same step ( Parent module 'oa.modules' not loaded) . Thank you !!

joshuashort commented 5 years ago

Thanks for the patience :)

It’s hard to say for sure since people configure their systems in all kinds of ways..

Is your system’s native/built-in version of Python 2.x or 3.x? You can check by just running python, not python3. If it’s 2.x, then pip is going to also be for 2.x, so it would seem like you have the dependencies installed, but they’re actually installed for the wrong version of Python. Also, pip3 might need to be installed separately.

Makes sense?

jiachenwei commented 5 years ago

Hello! I also meet this trouble. My env is base on anaconda python 3.6.2, and OS is Ubunut 18.04.

[2019-04-27 13:48:17,066] INFO     MainThread [__main__.py:<module>:94]    Start Open Assistant
[2019-04-27 13:48:17,066] INFO     MainThread [__main__.py:__init__:18]    Initializing Open Assistant
[2019-04-27 13:48:17,066] DEBUG    MainThread [agent.py:__init__:13]    <__main__.OpenAssistant object at 0x7fef5aeb7cc0>
[2019-04-27 13:48:17,066] INFO     MainThread [agent.py:_load_modules:33]    Loading Modules <- /home/jia/Downloads/oa-core-master/oa/modules
[2019-04-27 13:48:17,066] INFO     MainThread [util.py:load_module:60]    sound <- /home/jia/Downloads/oa-core-master/oa/modules/sound
[2019-04-27 13:48:17,066] ERROR    MainThread [agent.py:_load_modules:42]    Error loading sound: Parent module 'oa.modules' not loaded, cannot perform relative import
[2019-04-27 13:48:17,067] INFO     MainThread [util.py:load_module:60]    voice <- /home/jia/Downloads/oa-core-master/oa/modules/voice
[2019-04-27 13:48:17,067] ERROR    MainThread [agent.py:_load_modules:42]    Error loading voice: Parent module 'oa.modules' not loaded, cannot perform relative import
[2019-04-27 13:48:17,067] INFO     MainThread [util.py:load_module:60]    speech_recognition <- /home/jia/Downloads/oa-core-master/oa/modules/speech_recognition
[2019-04-27 13:48:17,067] ERROR    MainThread [agent.py:_load_modules:42]    Error loading speech_recognition: Parent module 'oa.modules' not loaded, cannot perform relative import
[2019-04-27 13:48:17,067] INFO     MainThread [util.py:load_module:60]    ear <- /home/jia/Downloads/oa-core-master/oa/modules/ear
[2019-04-27 13:48:17,067] ERROR    MainThread [agent.py:_load_modules:42]    Error loading ear: Parent module 'oa.modules' not loaded, cannot perform relative import
[2019-04-27 13:48:17,067] INFO     MainThread [util.py:load_module:60]    mind <- /home/jia/Downloads/oa-core-master/oa/modules/mind
[2019-04-27 13:48:17,067] ERROR    MainThread [agent.py:_load_modules:42]    Error loading mind: Parent module 'oa.modules' not loaded, cannot perform relative import
Traceback (most recent call last):
  File "/home/jia/anaconda3/envs/oa/lib/python3.6/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/jia/anaconda3/envs/oa/lib/python3.6/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/jia/Downloads/oa-core-master/oa/__main__.py", line 96, in <module>
    start()
  File "/home/jia/Downloads/oa-core-master/oa/__main__.py", line 44, in start
    a.parts['ear'].output += [a.parts.speech_recognition]
  File "/home/jia/Downloads/oa-core-master/oa/core/util.py", line 89, in __getitem__
    return getattr(self, key)
AttributeError: 'Core' object has no attribute 'ear'
xiaodongliu-nudt commented 5 years ago

Stuck here too. My env is Ubuntu 16.04 and Python 3.5. Any help?? P.S. 'pip3 install -r requirements.txt' is finished in my env.

jgrueb commented 5 years ago

Same behaviour on Debian 9.9, Python 3.5.3 and correctly installed dependencies.

joshuashort commented 5 years ago

Merge #14 (thanks @jgrueb) should make things work in master..

@analyticsUser @JiaChenwei @xiaodongliu-fighting : does this resolve the issue?

joshuashort commented 5 years ago

I probably missed something obvious, but I found some old code with a comment about this issue.. I think the merged solution is better than the workaround (i.e. hard-coding an import of the base namespace).