ImportError: no module named sounddevice - python

Currently trying to use sounddevice in some code I am writing, but I keep getting the error mentioned in the title.
So far, I have tried installed sounddevice in all python versions I have, uninstalled and reinstalled it a few times, added this to the top of the code:
'#!/usr/bin/env python3'
Also, I have tried reinstalling rtmidi-python, pyaudio, cffi, and sounddevice all at once and each individually
I also have ran the pip freeze command and I get these results, which are some of the modules I am looking to try to install, and am having issue with all:
'cffi==1.14.2
PyAudio==0.2.11
sounddevice==0.4.0'
To my knowledge, PyAudio is a Python version of PortAudio (which is only for C++ and C), so in order to use PortAudio/PyAudio needs to be installed to use sounddevice.
Sidenote: Not sure if it is related, but I also keep getting told to upgrade pip, but I do have the most up to date version, and keep getting this error when installing something:
`Error initializing entry point('gnome','keyrings.alt.Gnome',None,Distribution('keyrings.alt','3.4.0'))`
Please let me know what else I can try to get this to work, I am still a beginner and am not quite sure how some of this works. Thanks!

I had a similar issue with the sounddevice lib:
I created a new virtual env in pycharm and installed sounddevice via pip. In the IDE everything worked fine but when i used pyinstaller to build and executable, i got an import error on startup. What helped me was deinstalling sounddevice with pip, updating/reinstalling pip and installing it again, similar to the comments under the original post.
Maybe this will help someone else :)

Related

suddenly can't install packages to pycharm? (Installing dependencies from Pipfile.lock error?)

Error is posted here as pastebin, it's very long
'''https://pastebin.com/8ssgGNdL'''
(edit paste bin expired)
https://pastebin.com/BRuPeifp
I've since tried installing packages using pip3 and still get similar results. I haven't changed anything since the last time I installed 'requests'
I'm sorry if i'm asking an annoying question. I've googled similar questions but nothing seems to help. If anyone can point me in the right place to look and solve this for my self I will be very grateful.
The error states:
fatal error: 'SDL.h' file not found
and
For help with compilation see:', 'https://www.pygame.org/wiki/MacCompile'
It looks like one or more of the SDL dependencies is missing.
Have you installed SDL dependencies mentioned on that page using HomeBrew?
It seems like it's crashing while installing PyGame. According the PyGame's Getting Started page there seems to be some issues with newer version of OS X.
Quoting from the page:
If your examples aren't running and you are using a recent version of
Mac OS X; try this line to install pygame instead:
python3 -m pip install -U pygame==2.0.0.dev6 --user
Also looking over the Internet, the problem might be because of Python3.8 itself, and therefore requiring a newer version to resolve the issue.
~ Solved ~
pygame doesn't work with python3.8 so I had to use:
pipenv install pygame==2.0.0.dev6
when testing by trying to install other packages such as requests, I was met with the same error. This error was infact the error for pygame repeating itself (I don't understand why)

error: No module named pillow, requests or pywhatkit

pywhatkit, requests, and pillow are already installed in my system. But, during importing any one of these, ImportError occurs.
After installing it through jupyter notebook, I still got the same error.
Actually I am a student and a noob in this field, so you can underestimate me. and feel free to help.
I think you are using python 2 instead of python 3. This particular error happens to me too. I think it might help.
Installing via pip on your local won’t necessarily install it for the kernel in your jupyter notebook. I typically write something like %pip install {libraries_here} into a cell. After running that cell, I restart the kernel and the packages should be there.

How to fix Issue with PyAudio in Python

I tried installing Pyaudio in Python but Python says it requires Portaudio binding for the installation.Help me fix this please.My platform is Windows.I am using Python 3.7.2.
I did:
1.I followed the instructions provided in the portaudio website and generated dll file using visual studio.
The portaudio directory where the compiled files are located is my Desktop.
2.Anyway I have installed pyaudio using a setup(exe) file which i found somewhere.
So whenever i type the command "pip install pyaudio", it says the requirements are already fulfilled.
But when i use the alternative command "easy_install pyaudio",it shows an error related to portaudio.
3.And whenever I run a python file which uses pyaudio it again says binding is required.
So, I need the solution to bind Portaudio files which are in my desktop with python.
I searched everywhere for the solution but since I am a beginner, all the tutorials provided in different websites were hard to understand for me.
So please help me with a simple and descriptive solution.
Thanks in advance.
ouch, it seems like you have chosen a painful way to get pyaudio installed.
I never compile on windows, if I can't find a pre-compiled binary I will look around for a different way to get to where I want to (different library…)
you can uninstall with pip uninstall pyaudio
anyways, here's one way to get it working.
download and install a "miniconda" (google if you don't know what it is)
do conda install pyaudio in your "conda"-prompt
I did not truly check the install, but I did the conda install… and it would have installed both portaudio and pyaudio so I suppose it will work.

Installing Anaconda and the modules not working

I have just installed Anaconda and then when I tried to use Idle to use the module statsmodels it tells me it doesn't exist:
ModuleNotFoundError: No module named 'statsmodels'
If I then try installing the module using pip it tells me its there.
I have also tried uninstalling Anaconda and installing the modules separately but the connection times out. error image
I am at work so could this be due to the pip module being unable to get through the proxy?
If that is the case why did Anaconda not seem to work either?
I am still unable to get the libraries working on Idle. But I have started using Spyder, which came with Anaconda and all the libraries are working there.
This is fine for my purposes. Though it would be good to know why?
Thanks
Have you tired installing the individual packages via pip? I am running into the same problem. It was working for some, not for others....

Setuptools error when trying to install a package

I’m completely new to Python and I want to install the package py-webrtcvad in Windows 7, but I'm stuck at the error ImportError: No module named 'pip.utils.setuptools_build'. There is an answer to this problem in stackoverflow which seems to solve the problem for others, but it doesn't work for me.
Here’s a summary of what I’ve done and tried so far:
Installed Python 3.5 and set up the Windows path environment so
that it works from any directory.
Installed pip for Python.
Tried to install the package with python -m pip install webrtcvad,
but it failed, returning the error Unable to find vcvarsall.bat.
I found a blog that deals with the vcvarsall.bat
problem: blogs.msdn.microsoft.com/pythonengineering/2016/04/11/unable-to-find-vcvarsall-bat. Following the directions of that blog:
First I just installed Visual C++ Build Tools 2015 and tried installing the package straight away (without updating setuptools), but I received a lot of error messages (which I didn’t write down).
I tried reinstalling setuptools, which I did following the directions in https://pypi.python.org/pypi/setuptools: I removed the version of setuptools that came with my Python installation (v20), and installed the latest version (v30). This time I got a different error message when trying to install py-webrtcvad: ImportError: No module named 'pip.utils.setuptools_build'.
Asked for assistance in the Python official chat. They made three
suggestions:
Updating pip with python -m pip install --upgrade pip. Didn’t
work. Again, the error ImportError: No module named 'pip.utils.setuptools_build'.
Reinstalling Visual C++ Build Tools 2015. No difference, same error
again.
Reinstalling Python itself. The Python installer offers three
choices: Repair, modify and uninstall.
Repair: Didn’t work. Same error.
Modify: Doesn’t look like it offers useful modifications for this.
Uninstall: Uninstalled and reinstalled. Still the same error.
I’m out of ideas. Can you help me?
Note: I imagine this should be doable in Windows 7 with Python 3.5. However, if it isn't I'm open to trying anything different. For example, installing a different version of Python would be no problem at all. I could also try installing Linux if that will solve the problem.
There was a bug in version 2.0.8 of webrtcvad that caused it to use the wrong flags when compiling for Windows: it was using -DWEBRTC_POSIX instead of -DWIN32. This might have been the source of the "lot of error messages" you got during one of your early attempts.
The fixed version has been pushed to pypi as version 2.0.9. I've confirmed that pip install webrtcvad works correctly on Windows 10. I'm using a pretty fresh install of Python, so I would try it first without reinstalling setuptools.

Categories

Resources