how to install pyaudio 083546 - pyaudio

I got an error while installing pyaudio
I have downloaden portaudio but i am not sure where to put it. I am trying to create a SpeechRecognition program that won't work without speechrecognition.
The following error occurs:
C:\Users\lenovo>pip install pyaudio
Collecting pyaudio
Using cached https://files.pythonhosted.org/packages/ab/42/b4f04721c5c5bfc196ce156b3c768998ef8c0ae3654ed29ea5020c749a6b/PyAudio-0.2.11.tar.gz
Installing collected packages: pyaudio
Running setup.py install for pyaudio ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\lenovo\appdata\local\programs\python\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\lenovo\\AppData\\Local\\Temp\\pip-install-w_ldd4wb\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\lenovo\\AppData\\Local\\Temp\\pip-install-w_ldd4wb\\pyaudio\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\lenovo\AppData\Local\Temp\pip-record-ckrughg6\install-record.txt' --single-version-externally-managed --compile
cwd: C:\Users\lenovo\AppData\Local\Temp\pip-install-w_ldd4wb\pyaudio\
Complete output (9 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
copying src\pyaudio.py -> build\lib.win-amd64-3.7
running build_ext
building '_portaudio' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\lenovo\appdata\local\programs\python\python37\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\lenovo\\AppData\\Local\\Temp\\pip-install-w_ldd4wb\\pyaudio\\setup.py'"'"'; __file__='"'"'C:\\Users\\lenovo\\AppData\\Local\\Temp\\pip-install-w_ldd4wb\\pyaudio\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\lenovo\AppData\Local\Temp\pip-record-ckrughg6\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.
edit:
I found a solution for windows!
go to https://www.lfd.uci.edu/~gohlke/pythonlibs/
and then press
ctrl + f
to find "pyaudio"
you will get
go and find something like this
PyAudio: bindings for the PortAudio library. Includes ASIO, DS, WMME, WASAPI, WDMKS support. PyAudio‑0.2.11‑cp310‑cp310‑win_amd64.whl PyAudio‑0.2.11‑cp310‑cp310‑win32.whl PyAudio‑0.2.11‑cp39‑cp39‑win_amd64.whl PyAudio‑0.2.11‑cp39‑cp39‑win32.whl PyAudio‑0.2.11‑cp38‑cp38‑win_amd64.whl PyAudio‑0.2.11‑cp38‑cp38‑win32.whl PyAudio‑0.2.11‑cp37‑cp37m‑win_amd64.whl PyAudio‑0.2.11‑cp37‑cp37m‑win32.whl PyAudio‑0.2.11‑cp36‑cp36m‑win_amd64.whl PyAudio‑0.2.11‑cp36‑cp36m‑win32.whl PyAudio‑0.2.11‑cp35‑cp35m‑win_amd64.whl PyAudio‑0.2.11‑cp35‑cp35m‑win32.whl PyAudio‑0.2.11‑cp34‑cp34m‑win_amd64.whl PyAudio‑0.2.11‑cp34‑cp34m‑win32.whl PyAudio‑0.2.11‑cp27‑cp27m‑win_amd64.whl PyAudio‑0.2.11‑cp27‑cp27m‑win32.whl
now download the one which is of same version of your python and OS
now after downloading open your cmd/terminal
go to its path and then
pip install <Pyaudio-blablabla> <= your file name
now it will be installed!
Enjoy!

The last line of the stacktrace contains the error:
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": https://visualstudio.microsoft.com/downloads/
This error can be fixed by installing the suggested tools from:
https://visualstudio.microsoft.com/visual-cpp-build-tools/

Related

Getting error while trying "pip install python-docx" in pycharm terminal

New to python and just trying pip install python-docx and getting this message:
Command "C:\Users\samue\PycharmProjects\testings\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file
__='C:\Users\samue\AppData\Local\Temp\pip-install-_4bceyq4\lxml\setup.py';f=getattr(tokenize, 'open', open
)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record
C:\Users\samue\AppData\Local\Temp\pip-record-pg5bpdaa\install-record.txt --single-version-externally-managed --com
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\VC\Tools\MSVC\14.26.28801\bin\Hos
tX86\x86\cl.exe' failed with exit status 2
----------------------------------------
Command "C:\Users\samue\PycharmProjects\testings\venv\Scripts\python.exe -u -c "import setuptools, tokenize;file='C:\Users
\samue\AppData\Local\Temp\pip-install-_4bceyq4\lxml\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().re
place('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\samue\AppData\Local\Temp\pip-reco
rd-pg5bpdaa\install-record.txt --single-version-externally-managed --compile --install-headers C:\Users\samue\PycharmProjects\te
stings\venv\include\site\python3.8\lxml" failed with error code 1 in C:\Users\samue\AppData\Local\Temp\pip-install-_4bceyq4\lxml
\
When you install with pip you use the command pip and not python.
To see whether pip is correctly installed type:
pip help
See the following page for how to install and configure pip on Windows:
https://phoenixnap.com/kb/install-pip-windows
Your error output shows a problem with lxml. Looking into it I have found the page pip install lxml error which suggests the following solution:
sudo apt-get install --reinstall python-dev libpython2.7-dev.

Error in installing Dash module - 'Failed building wheel for brotli'

I am new to the coding world and trying to build my skills in Python as a stepping stone for Data Analytics.
I am facing a problem in installing Dash module on my local machine. The error where it is getting stuck is 'Failed building wheel for brotli'
I am using Windows 10 / Python 3.9.0 / PIP 20.2.4 / pycharm.
I have been able to successfully install plotly and while installing dash module - first I got the error of 'wheel' not installing - which got rectified by installing wheel module (pip install wheel). Later the error for dash was 'Failed building wheel for brotli'. Had tried installing using command prompt(pip) as well as PyCharm.
Can someone please help. Below is the log that I am getting.
C:\WINDOWS\system32>pip install dash
Requirement already satisfied: dash in c:\users\arinjay jaiswal\appdata\local\programs\python\python39\lib\site-packages (0.17.7)
Requirement already satisfied: Flask>=0.12 in c:\users\arinjay jaiswal\appdata\local\programs\python\python39\lib\site-packages (from dash) (1.1.2)
Requirement already satisfied: plotly in c:\users\arinjay jaiswal\appdata\local\programs\python\python39\lib\site-packages (from dash) (4.14.1)
Requirement already satisfied: flask-compress in c:\users\arinjay jaiswal\appdata\local\programs\python\python39\lib\site-packages\flask_compress-1.8.0-py3.9.egg (from dash) (1.8.0)
Requirement already satisfied: flask-seasurf in c:\users\arinjay jaiswal\appdata\local\programs\python\python39\lib\site-packages (from dash) (0.2.2)
Requirement already satisfied: Jinja2>=2.10.1 in c:\users\arinjay jaiswal\appdata\local\programs\python\python39\lib\site-packages (from Flask>=0.12->dash) (2.11.2)
Requirement already satisfied: click>=5.1 in c:\users\arinjay jaiswal\appdata\local\programs\python\python39\lib\site-packages (from Flask>=0.12->dash) (7.1.2)
Requirement already satisfied: itsdangerous>=0.24 in c:\users\arinjay jaiswal\appdata\local\programs\python\python39\lib\site-packages (from Flask>=0.12->dash) (1.1.0)
Requirement already satisfied: Werkzeug>=0.15 in c:\users\arinjay jaiswal\appdata\local\programs\python\python39\lib\site-packages (from Flask>=0.12->dash) (1.0.1)
Requirement already satisfied: six in c:\users\arinjay jaiswal\appdata\roaming\python\python39\site-packages (from plotly->dash) (1.15.0)
Requirement already satisfied: retrying>=1.3.3 in c:\users\arinjay jaiswal\appdata\local\programs\python\python39\lib\site-packages (from plotly->dash) (1.3.3)
Collecting brotli
Using cached Brotli-1.0.9.zip (510 kB)
Requirement already satisfied: MarkupSafe>=0.23 in c:\users\arinjay jaiswal\appdata\local\programs\python\python39\lib\site-packages (from Jinja2>=2.10.1->Flask>=0.12->dash) (1.1.1)
Building wheels for collected packages: brotli
Building wheel for brotli (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\arinjay jaiswal\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Arinjay Jaiswal\\AppData\\Local\\Temp\\pip-install-4jna0pqh\\brotli\\setup.py'"'"'; __file__='"'"'C:\\Users\\Arinjay Jaiswal\\AppData\\Local\\Temp\\pip-install-4jna0pqh\\brotli\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\Arinjay Jaiswal\AppData\Local\Temp\pip-wheel-t7_2ranf'
cwd: C:\Users\Arinjay Jaiswal\AppData\Local\Temp\pip-install-4jna0pqh\brotli\
Complete output (18 lines):
running bdist_wheel
running build
running build_py
creating bin
creating bin\lib.win-amd64-3.9
copying python\brotli.py -> bin\lib.win-amd64-3.9
running build_ext
building '_brotli' extension
creating bin\temp.win-amd64-3.9
creating bin\temp.win-amd64-3.9\Release
creating bin\temp.win-amd64-3.9\Release\c
creating bin\temp.win-amd64-3.9\Release\c\common
creating bin\temp.win-amd64-3.9\Release\c\dec
creating bin\temp.win-amd64-3.9\Release\c\enc
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic/include -Ic:\users\arinjay jaiswal\appdata\local\programs\python\python39\include -Ic:\users\arinjay jaiswal\appdata\local\programs\python\python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include /Tcc/common/constants.c /Fobin\temp.win-amd64-3.9\Release\c/common/constants.obj
constants.c
C:\Users\Arinjay Jaiswal\AppData\Local\Temp\pip-install-4jna0pqh\brotli\c\common\./platform.h(26): fatal error C1083: Cannot open include file: 'string.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.26.28801\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
----------------------------------------
ERROR: Failed building wheel for brotli
Running setup.py clean for brotli
Failed to build brotli
Installing collected packages: brotli
Running setup.py install for brotli ... error
ERROR: Command errored out with exit status 1:
command: 'c:\users\arinjay jaiswal\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Arinjay Jaiswal\\AppData\\Local\\Temp\\pip-install-4jna0pqh\\brotli\\setup.py'"'"'; __file__='"'"'C:\\Users\\Arinjay Jaiswal\\AppData\\Local\\Temp\\pip-install-4jna0pqh\\brotli\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Arinjay Jaiswal\AppData\Local\Temp\pip-record-lnmkirsr\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\arinjay jaiswal\appdata\local\programs\python\python39\Include\brotli'
cwd: C:\Users\Arinjay Jaiswal\AppData\Local\Temp\pip-install-4jna0pqh\brotli\
Complete output (18 lines):
running install
running build
running build_py
creating bin
creating bin\lib.win-amd64-3.9
copying python\brotli.py -> bin\lib.win-amd64-3.9
running build_ext
building '_brotli' extension
creating bin\temp.win-amd64-3.9
creating bin\temp.win-amd64-3.9\Release
creating bin\temp.win-amd64-3.9\Release\c
creating bin\temp.win-amd64-3.9\Release\c\common
creating bin\temp.win-amd64-3.9\Release\c\dec
creating bin\temp.win-amd64-3.9\Release\c\enc
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic/include -Ic:\users\arinjay jaiswal\appdata\local\programs\python\python39\include -Ic:\users\arinjay jaiswal\appdata\local\programs\python\python39\include -IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\include /Tcc/common/constants.c /Fobin\temp.win-amd64-3.9\Release\c/common/constants.obj
constants.c
C:\Users\Arinjay Jaiswal\AppData\Local\Temp\pip-install-4jna0pqh\brotli\c\common\./platform.h(26): fatal error C1083: Cannot open include file: 'string.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.26.28801\\bin\\HostX86\\x64\\cl.exe' failed with exit code 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'c:\users\arinjay jaiswal\appdata\local\programs\python\python39\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Arinjay Jaiswal\\AppData\\Local\\Temp\\pip-install-4jna0pqh\\brotli\\setup.py'"'"'; __file__='"'"'C:\\Users\\Arinjay Jaiswal\\AppData\\Local\\Temp\\pip-install-4jna0pqh\\brotli\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\Arinjay Jaiswal\AppData\Local\Temp\pip-record-lnmkirsr\install-record.txt' --single-version-externally-managed --compile --install-headers 'c:\users\arinjay jaiswal\appdata\local\programs\python\python39\Include\brotli' Check the logs for full command output.

Can't Install MySQL-Connector Library

I was using the mysql-connector 2.1.8 for a while and out of a sudden, it was no longer available.
Could not find a version that satisfies the requirement mysql-connector==2.1.8 (from versions: 2.2.8)
I tried installing some newer versions, like 2.2.5. Which literally worked once and then didn't on a server.
And the latest version 2.2.8 gives an error like this:
Collecting mysql-connector==2.2.8
Using cached https://files.pythonhosted.org/packages/8e/78/049f747325ce0154263cd1b10fe7ea9ddb17e839111c6f8f824d5964cfb5/mysql-connector-2.2.8.tar.gz
Installing collected packages: mysql-connector
Running setup.py install for mysql-connector ... error
Complete output from command /home/liudas/PycharmProjects/eneba_what_place/venv/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-7rlbpvfn/mysql-connector/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-kbw8r138/install-record.txt --single-version-externally-managed --compile --install-headers /home/liudas/PycharmProjects/eneba_what_place/venv/include/site/python3.6/mysql-connector:
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: option --single-version-externally-managed not recognized
pip install -U setuptools wheel
Newer package version might require newer features of setuptools or wheel, so it's what causes --single-version-externally-managed not recognized
A good thing to keep such core packages up to date, plus they are almost always backwards compatible.

Unable to install Python-igraph using pip in ubuntu

I got following error when I am trying to install python-igraph using sudo pip install python-igraph
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-ZHOdbM/python-igraph/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-MGaN23-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-ZHOdbM/python-igraph/
I also try to install C core using the link given in the answer UnicodeDecodeError when installing python-igraph
I would suggest you to use conda and the following command :
conda install -c conda-forge python-igraph
https://anaconda.org/conda-forge/python-igraph

Mac OS Sierra virtualenv (python 2.7) pip install mysqlclient error

On Mac OS Sierra, created virtualenv using python2.7 and trying to install mysqlclient to use Django w/ MySQL. I installed MySQL 5.6 via homebrew. Running "pip install mysqlclient" gives these errors:
Running setup.py bdist_wheel for mysqlclient ... error
...
13 warnings generated.
cc -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -Wl,-F. build/temp.macosx-10.12-intel-2.7/_mysql.o -L/usr/local/Cellar/mysql56/5.6.32/lib -lmysqlclient -lssl -lcrypto -o build/lib.macosx-10.12-intel-2.7/_mysql.so
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'cc' failed with exit status 1
Failed building wheel for mysqlclient
Command "...env2.7/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/nm/mqfwjt115q7g0lpvnx7sylwm0000gn/T/pip-build-tJmAVS/mysqlclient/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/nm/mqfwjt115q7g0lpvnx7sylwm0000gn/T/pip-xVuIu1-record/install-record.txt --single-version-externally-managed --compile --install-headers .../env2.7/include/site/python2.7/mysqlclient" failed with error code 1 in /private/var/folders/nm/mqfwjt115q7g0lpvnx7sylwm0000gn/T/pip-build-tJmAVS/mysqlclient/
Any help would be greatly appreciated.
The answer was installing dev tools using:
xcode-select --install
In my case I needed to do two steps:
xcode-select --install
as #howevilweare says AND also pip install with the brew installed openssl using an env command:
env LDFLAGS="-I/usr/local/opt/openssl/include -L/usr/local/opt/openssl/lib" pip install mysqlclient