No module named 'pyaudio' - python

I am writing a program in Python, But I got an error
ModuleNotFoundError: No module named 'pyaudio'
Then I tried
pipwin install pyaudio
It came out
Requirement already satisfied: PyAudio==0.2.11 from file:///C:/Users/JIE_0305/pipwin/PyAudio-0.2.11-cp37-cp37m-win_amd64.whl
but I run the program again, it still
ModuleNotFoundError: No module named 'pyaudio'
How can I solve the problem?

You could download the whl file and call it when installing, this might work, according to this post. In the post, you have the links to the site where you can download the whl file.
It is also stated that it might work with Python 3.6 and not 3.7, try changing your Python version to 3.6, if the other options give not result.
Another solution is uninstalling pyaudio, then connecting to your virtual environement and install again withing your venv. It might solve your problem.
Sometimes it happens that a library successfully installed might be related to a Python version which is different than the one you used when running the program. You should check this also, I mean check to which Python version the pyaudio library is related. Use the same Python version in order to run the program.

Try refreshing first with
pipwin refresh
If not use pip instead
pip install pyaudio --> python2
pip3 install pyaudio --> python3

Please try to use the pip command instead.
python3 -m pip install pyaudio # for python 3
or
python -m pip install pyaudio # for python 2 or lower

Related

Installing the pyaudio module on Windows with pip

I am trying to install the pyaudio module..I have tried several methods that were discussed previously on stackoverflow and other platforms related to pyaudio but nothing that were discussed were working correctly..I have installed all the required packages required to install pyaudio but nothing seems to be working.. I have the latest version of pip and i am using python 3.7 version...Here is what i am getting
ModuleNotFoundError: No module named 'pyaudio'
PyAudio hasn't been officially updated on PyPl yet to work with Python 3.7
First download the .whl file for your system from here. Then run pip again with this command:
pip install "path/to/your/.whl/file"
You can install pyaudio externally through website.
Website : https://www.lfd.uci.edu/~gohlke/pythonlibs/
Search for PyAudio and download it

Getting ImportError: No module named 'Crypto' after installation

I am getting ImportError: No module named 'Crypto' error when trying to run. I have installed pycrypto using pip install pycrypto and updated it also. Everything I have tried to far has been unsuccessful.
Tried:
reinstalling pycrypto,
updating both python and pycrypto
Any suggestions?
The error messages says, it does not able to find the module so please try to run below command,
#pip list -- # what does it show to you, if it would have installed successfully it will show you up there.
if "pip install pycrypto" doesn't work so try to download the source tar ball and try to install it from prompt.
pip download pycrypto
it will download tar.gz file.. so you can install using with pip install --no-index --find-links /path/to/some/dir/ pycrypto
for python3.5 version
python3.5 -m pip install pycrypto
this will install in python3.5 environment and after that you can able to import pycrypto module
Is python defined properly on your machine?
Make sure PATH environment variable has python's installation folder in it

import graph tool doesn't work on iPython

I installed graph-tool on ubuntu. When trying to import it in iPython I get an error:
ImportError: No module named graph_tool.all
As I read in other posts it might be possible that I used a different version of python for installing graph-tools than the system version I'm using. My question is now, how do I check which version graph-tool is installed with and how do i change this in order to import it?
Thanks for any advice!
If you install using pip you can check
pip -V
result (for example)
pip 8.0.2 from /usr/local/lib/python3.5/dist-packages (python 3.5)
You should have pip, pip2, pip2.7, pip3, pip3.4, etc. to install with different Python.
(in bash write pip and press tab twice to see all programs started with pip)

Import Error: No module named requests

I know there are many posts on this, and I've tried using the solutions provided, but to no avail. I tried pip install requests and pip install requests --upgrade:
pip install requests --upgrade
You are using pip version 7.1.0, however version 7.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Requirement already up-to-date: requests in /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
I then tried running pip install --upgrade pip, yet when I run my file I still get
Import Error: No module named requests
I am able to use requests in PyCharm, so I don't know what's causing this. Can someone please help?
You installed requests into a different Python installation. The /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages is the site-packages directory for the Mac OS X /usr/bin/python installation.
PyCharm is not currently configured to use that Python installation; check what Python is being used either by looking at your PyCharm settings, or by asking Python directly with:
import sys
print(sys.executable)
Note that PyCharm can handle package installations for you as well; rather than use the command line pip consider using PyCharm, as it'll use the currently configured Python installation in that case.
install package name "request" from pychram package setting. then it will be work fine.
If you are having this issue in Pycharm and you have configured your Pycharm to create projects in virtual environments, then you can use the Terminal in Pycharm to run the
pip3 install requests
to resolve this issue. This is by design to ensure you control dependencies.

pip setup and setting PYTHONPATH

I'm not experienced in Python, and I need the requests module.
I've tried installing it using pip install requests
The installation went successfully, but when I try to import the module, I get an error like "no module named requests".
Should I add the install location to PYTHONPATH? If yes, how can I find the location where pip installed the files? I don't know about virtualenv, and I am using Ubuntu.
You should install pip for python3 first
How to install pip with Python 3?
then with the pip-3.X install the required module.

Categories