-
Notifications
You must be signed in to change notification settings - Fork 221
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
syntax error and module error #8
Comments
One thing is that instead of using import matplotlib
matplotlib.use('TkAgg') But remember that in order to have the TkAgg backend, you must have Secondly, pyaudio must be installed. In order to check if that has been installed, try importing it in the Python Shell. If the module has not been found, then that means that it has not been properly installed. import pyaudio In order to install pyaudio, you need to install portaudio. After that, you can safely install pyaudio with no errors sudo pip install PyAudio
Another thing to notify here is that portaudio is programmed in C, so you need to build it using something like Microsoft Visual Studio. I hope I helped you with your issue! P.S - I am not an artificial intelligent program or robot! |
Thank you so much for your reply!!!!. Ill try that tomorrow afternoon as its almost midnight here now. One question. Will port audio (as you mention it being programmed in c) actually work on rasberry pi? As i wont be able to run MVS on the Pi? Will it be a problem? If so is there an alternative?? Sam |
Yes it should, I have done this process on a Linux laptop. All you need to do is configure and build portaudio before installing pyaudio. ./configure && make
Just remember that PyAudio is sort of like an interface between PortAudio and Python! Another thing is that if you are having doubts that you do not have python tk, you can check by importing tkinter - import tkinter as tk If it gives an error, then you have to install it - sudo apt-get install python-tk
sudio apt-get install python3-tk
Then try importing it again! 😄 |
Another thing to note is that when you have matplotlib.use('TkAgg') Because when you have the TkAgg backend, that is your default backend. |
okay, so I did everything you said. I think we got rid of the matplotlib problems but we still have issues with the pyaudio modules not found. the only thing you said to do that I 'couldn't' do was the ./confige && make where was that suppose to go?? also could not specifically install portaudio. not sure if I was supposed to be able to but yeah |
The part where you have to build portaudio is actually from the documentation - http://www.portaudio.com Again, the reason why pyaudio was not installed was because it couldn't technically find PortAudio. See, in order for PortAudio to be recognised, it needs to be built. Installation for PyAudio is also mentioned here, however it doesn't mention how to install PortAudio, make it recognisable for PyAudio, which is why you need to go to the PortAudio documentation - https://people.csail.mit.edu/hubert/pyaudio/ I hope that helped with the PyAudio problem! |
This is what the PyAudio documentation mentions -
I have also found a reference to this issue - I hope that helped with the issue! |
Hello,
I am trying to use this code on a raspberry pito make a live oscilloscope (as a prototype) for my modular synthesizer. I have 2 main errors.
one says:
File "/home/pi/Desktop/Waveformviewer1.py", line 13
%matplotlib tk
^
SyntaxError: invalid syntax
I tried bypassing it by commenting it with a #. but it brought up:
To resolve this I have tried running install commands in the terminal updates upgrades all that sort of back-end stuff but it's still not working.
please help
The text was updated successfully, but these errors were encountered: