rcbyron / hey-athena-client

Your personal voice assistant
https://heyathena.com
MIT License
421 stars 98 forks source link

ImportError: cannot import name 'urlencode' #22

Closed kuboosoft closed 8 years ago

kuboosoft commented 8 years ago

Hi. I am trying to create an RPM for Fedora Linux. I builded a rpm for all dependencies for athena-voice-client (a large list of dependencies), but I don't explain the error "ImportError: cannot import name 'urlencode'"

Complete log:

[root@localhost athena]# python3 brain.py ~ Users: 'makerpm'

~ Username: makerpm

~ Logged in as: makerpm ~ Looking for modules in: '/usr/lib/python3.4/site-packages/athena/modules/active' Traceback (most recent call last): File "brain.py", line 25, in find_mods mod = finder.find_module(name).load_module(name) File "", line 539, in _check_name_wrapper File "", line 1614, in load_module File "", line 596, in _load_module_shim File "", line 1220, in load File "", line 1200, in _load_unlocked File "", line 1129, in _exec File "", line 1471, in exec_module File "", line 321, in _call_with_frames_removed File "/usr/lib/python3.4/site-packages/athena/modules/active/gmail.py", line 8, in from athena.modules.api_library import gmail_api File "/usr/lib/python3.4/site-packages/athena/modules/api_library/gmail_api.py", line 19, in from apiclient import discovery File "/usr/lib/python3.4/site-packages/apiclient/init.py", line 1, in from .base import APIClient, APIClient_SharedSecret File "/usr/lib/python3.4/site-packages/apiclient/base.py", line 4, in from urllib import urlencode ImportError: cannot import name 'urlencode'

~ Error loading 'gmail' cannot import name 'urlencode' ~ Please properly configure the weather API Traceback (most recent call last): File "brain.py", line 160, in start() File "brain.py", line 155, in start find_mods() File "brain.py", line 35, in find_mods modules.sort(key=lambda mod: mod.priority, reverse=True) File "brain.py", line 35, in modules.sort(key=lambda mod: mod.priority, reverse=True) AttributeError: 'Weather' object has no attribute 'priority'

rcbyron commented 8 years ago

Hey again! The gmail module / api is still under work. We temporarily took out both the gmail module and gmail api file. Try downloading the latest version of the athena-voice-client repository. That should fix this error. As always, if this still doesn't work, let me know.

kuboosoft commented 8 years ago

Thanks, I'm tired; but I am very happy because I have solved all the dependencies. pip3 isn't installed complety all the dependencies. I will try tomorrow cloning again the repository.

kuboosoft commented 8 years ago

Well; now the next result:

[root@localhost athena]# python3 brain.py ~ Users: 'davidva'

~ Username: davidva

~ Logged in as: davidva ~ Looking for modules in: '/usr/lib/python3.4/site-packages/athena/modules/active' ~ Please properly configure the weather API Traceback (most recent call last): File "brain.py", line 160, in start() File "brain.py", line 155, in start find_mods() File "brain.py", line 35, in find_mods modules.sort(key=lambda mod: mod.priority, reverse=True) File "brain.py", line 35, in modules.sort(key=lambda mod: mod.priority, reverse=True) AttributeError: 'Weather' object has no attribute 'priority'

rcbyron commented 8 years ago

Ahh this is because the weather_api must be properly configured. It attempted to disable the Weather module because the location couldn't be found. I'm still working on the 'disable module' feature. Anyway, the user's .yml file must store a valid wunderground location. Try using a 5 digit zipcode or somewhere like Dallas, TX when configuring your user.

kuboosoft commented 8 years ago

mmm, added 5 digit to zipcode using to test 73301 (I am from out USA); Well now I receive a message about "pocketsphinx"

full log: [root@localhost athena]# python3 brain.py ~ Users: 'davidva'

~ Username: davidva

~ Logged in as: davidva ~ Looking for modules in: '/usr/lib/python3.4/site-packages/athena/modules/active'

~ Module Order: 'emotion', 'bitcoin', 'conversation', 'geo_info', 'music', 'spotify', 'weather', 'wolfram'

 _   _   _                      
/ \ | |_| |__   ___ _ __   __ _ 

/ | **| ' \ / \ ' \ / _` | / \ || | | | / | | | (| | // **|| |||| ||\,_|


  \ \   / /__ (_) ___ ___  
   \ \ / / _ | |/ **/ _ \  
    \ V / (_) | | (_|  __/  
     _/ _**/|_|______|      

~ Hey there, davidva!

Traceback (most recent call last): File "brain.py", line 160, in start() File "brain.py", line 158, in start stt.init() File "/usr/lib/python3.4/site-packages/athena/stt.py", line 34, in init decoder = Decoder(config) File "/usr/lib64/python3.4/site-packages/pocketsphinx/pocketsphinx.py", line 326, in init this = _pocketsphinx.new_Decoder(*args) RuntimeError: new_Decoder returned -1

rcbyron commented 8 years ago

I'm looking into this issue... however my initial thoughts are: pocketsphinx is not properly installed OR your microphone isn't being detected by PyAudio (which is used by pocketsphinx). It might be helpful to try a different mic (I use one with a USB connector).

kuboosoft commented 8 years ago

mmm, PyAudio. I made a rpm (0.2.9) Do you think affect it?. Also I used the current pocketsphinx https://github.com/cmusphinx/pocketsphinx. I will try downgrade PyAudio to 0.2.8 and test again.

sahilshahh commented 8 years ago

Hi,

What version of PyAudio are you using? I believe that you need to use the 32 bit version of PyAudio for it to work. It could also be that the Python/PyAudio/Pocketsphinx versions must match (e.g. all 32 bit or all 64 bit)