Realtime_PyAudio_FFT icon indicating copy to clipboard operation
Realtime_PyAudio_FFT copied to clipboard

Error message on startup

Open WinEunuuchs2Unix opened this issue 4 years ago • 0 comments

Super cool program. Congrats.

I'm going to try this with Ubuntu 16.04 (Python 2.7.12) so will have to do a little tweaking.

Tweak #1:

Error message on startup:

~/python/audio$ python run_FFT_analyzer.py

Traceback (most recent call last):
  File "run_FFT_analyzer.py", line 2, in <module>
    from src.stream_analyzer import Stream_Analyzer
ImportError: No module named src.stream_analyzer

To fix this error I used:

~/python/audio$ cd src

~/python/audio/src$ echo "" > __init__.py

TWEAK #2:

I'll be revising this comment from time to time as I run into new issues. For example I will need to add program header stub for UTF-8 encoding due to this new error that popped up after fixing above error:

$ python run_FFT_analyzer.py
Traceback (most recent call last):
  File "run_FFT_analyzer.py", line 58, in <module>
    run_FFT_analyzer()
  File "run_FFT_analyzer.py", line 45, in run_FFT_analyzer
    window_ratio = window_ratio  # Float ratio of the visualizer window. e.g. 24/9
  File "/home/rick/python/audio/src/stream_analyzer.py", line 50, in __init__
    from src.stream_reader_sounddevice import Stream_Reader
  File "/home/rick/python/audio/src/stream_reader_sounddevice.py", line 131
SyntaxError: Non-ASCII character '\xf0' in file /home/rick/python/audio/src/stream_reader_sounddevice.py on line 131, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

This is solved by inserting one line:

# -*- coding: utf-8 -*-

TWEAK #3:

The next error that appears:

$ python run_FFT_analyzer.py
Traceback (most recent call last):
  File "run_FFT_analyzer.py", line 58, in <module>
    run_FFT_analyzer()
  File "run_FFT_analyzer.py", line 45, in run_FFT_analyzer
    window_ratio = window_ratio  # Float ratio of the visualizer window. e.g. 24/9
  File "/home/rick/python/audio/src/stream_analyzer.py", line 50, in __init__
    from src.stream_reader_sounddevice import Stream_Reader
  File "/home/rick/python/audio/src/stream_reader_sounddevice.py", line 5, in <module>
    import sounddevice as sd
ImportError: No module named sounddevice

This is more complicated a fix as described here:

Because the solutions provided use pip or pip3 in Ubuntu which won't work because I only sudo apt install the real solution will be more complicated.

WinEunuuchs2Unix avatar Jan 21 '21 00:01 WinEunuuchs2Unix