New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

executables breaking on ImportError after fresh clone on latest Raspbian Strech #133

Closed
zizipoil opened this Issue Sep 16, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@zizipoil

zizipoil commented Sep 16, 2017

Hello,

I'm having issues running the different executables present in /src
They all seem to return import errors.

config

I use a raspberry pi 3b.
I use the latest Raspbian 'Strech with desktop' image (Release date:2017-09-07, Kernel version:4.9)
I cloned the main branch of this repo and followed the steps written in HACKING.md. No errors to report at this stage.

I am not using the voice hat, so I use my own version of /etc/asound.conf to use the jack as output and a USB mic.

tests

Checkpoints check_audio.py, check_cloud.py and check_wifi.py all work fine.
Checkpoint load_test.py fails (see Traces)

Traces

These are the traces I get for the different executables of the src folder:

main.py

pi@raspberrypi:~/voice-recognizer-raspi $ src/main.py 
Traceback (most recent call last):
  File "src/main.py", line 26, in <module>
    import configargparse
ImportError: No module named 'configargparse'

cloudspeech_demo.py

pi@raspberrypi:~/voice-recognizer-raspi $ src/cloudspeech_demo.py 
Traceback (most recent call last):
  File "src/cloudspeech_demo.py", line 21, in <module>
    import aiy.cloudspeech
  File "/home/pi/voice-recognizer-raspi/src/aiy/cloudspeech.py", line 19, in <module>
    import aiy._apis._speech
  File "/home/pi/voice-recognizer-raspi/src/aiy/_apis/_speech.py", line 24, in <module>
    import google.auth
ImportError: No module named 'google'

assistant_grpc_demo.py

pi@raspberrypi:~/voice-recognizer-raspi $ src/assistant_grpc_demo.py 
Traceback (most recent call last):
  File "src/assistant_grpc_demo.py", line 21, in <module>
    import aiy.assistant.grpc
  File "/home/pi/voice-recognizer-raspi/src/aiy/assistant/grpc.py", line 19, in <module>
    import aiy._apis._speech
  File "/home/pi/voice-recognizer-raspi/src/aiy/_apis/_speech.py", line 24, in <module>
    import google.auth
ImportError: No module named 'google'

assistant_library_demo.py

pi@raspberrypi:~/voice-recognizer-raspi $ src/assistant_library_demo.py 
Traceback (most recent call last):
  File "src/assistant_library_demo.py", line 30, in <module>
    import aiy.assistant.auth_helpers
  File "/home/pi/voice-recognizer-raspi/src/aiy/assistant/auth_helpers.py", line 24, in <module>
    import google_auth_oauthlib.flow
ImportError: No module named 'google_auth_oauthlib'

assistant_library_with_button_demo.py

pi@raspberrypi:~/voice-recognizer-raspi $ src/assistant_library_with_button_demo.py 
Traceback (most recent call last):
  File "src/assistant_library_with_button_demo.py", line 31, in <module>
    import aiy.assistant.auth_helpers
  File "/home/pi/voice-recognizer-raspi/src/aiy/assistant/auth_helpers.py", line 24, in <module>
    import google_auth_oauthlib.flow
ImportError: No module named 'google_auth_oauthlib'

load_test.py

pi@raspberrypi:~/voice-recognizer-raspi $ ./checkpoints/load_test.py 
Running test forever - press Ctrl+C to stop...
recording  Traceback (most recent call last):
  File "./checkpoints/load_test.py", line 181, in <module>
    main()
  File "./checkpoints/load_test.py", line 173, in main
    run_test()
  File "./checkpoints/load_test.py", line 145, in run_test
    record_wav()
  File "./checkpoints/load_test.py", line 121, in record_wav
    stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
  File "/usr/lib/python3.5/subprocess.py", line 271, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/home/pi/voice-recognizer-raspi/env/bin/python3', '/home/pi/voice-recognizer-raspi/src/aiy/audio.py', 'dump', '/tmp/tmpfwzdt9he.wav', '-d', '3']' returned non-zero exit status 1
Press Enter to close...`

my 2 cents

As you can see all executables fail with import errors.
I'm suspecting that /scripts/install-deps.sh is somehow creating the error.

Thanks in advance for your help
Raph

@zizipoil zizipoil changed the title from executables breaking on ImportError after fresh install of latest Raspbian to executables breaking on ImportError after fresh clone on latest Raspbian Sep 16, 2017

@zizipoil zizipoil changed the title from executables breaking on ImportError after fresh clone on latest Raspbian to executables breaking on ImportError after fresh clone on latest Raspbian Strech Sep 16, 2017

@zizipoil

This comment has been minimized.

zizipoil commented Sep 16, 2017

Just realised that running

cd ~/voice-recognizer-raspi
source env/bin/activate
python3 src/main.py

prevents these errors form happening.
But is that the way things are supposed to be ran? (aka in a virtual env)

@sheridat

This comment has been minimized.

sheridat commented Sep 16, 2017

Yes it is meant to be run in it's own python virtual environment.

@zizipoil

This comment has been minimized.

zizipoil commented Sep 21, 2017

Ok, I'll close the issue then.
Thanks for your answer

@zizipoil zizipoil closed this Sep 21, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment