How to install pyodbc python library in server? - python

I have python 3.8 and I am trying to install pyodbc library to connect sql server but getting error. Please help me how to install it? Is there any other library to connect sql server?
I am using below command -
python3 -m pip install pyodbc
Error I am getting-
Collecting pyodbc
Using cached pyodbc-4.0.30.tar.gz (266 kB)
Building wheels for collected packages: pyodbc
Building wheel for pyodbc (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-fnygoose/pyodbc_7db1b044e510447c8352fe2f54d4cbe0/setup.py'"'"'; __file__='"'"'/tmp/pip-install-fnygoose/pyodbc_7db1b044e510447c8352fe2f54d4cbe0/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 /tmp/pip-wheel-67s6uwc7
cwd: /tmp/pip-install-fnygoose/pyodbc_7db1b044e510447c8352fe2f54d4cbe0/
Complete output (10 lines):
running bdist_wheel
running build
running build_ext
building 'pyodbc' extension
creating build
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/src
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPYODBC_VERSION=4.0.30 -I/app/python3.7.4/include/python3.7m -c src/buffer.cpp -o build/temp.linux-x86_64-3.7/src/buffer.o -Wno-write-strings
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for pyodbc
Running setup.py clean for pyodbc
Failed to build pyodbc
Installing collected packages: pyodbc
Running setup.py install for pyodbc ... error
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-fnygoose/pyodbc_7db1b044e510447c8352fe2f54d4cbe0/setup.py'"'"'; __file__='"'"'/tmp/pip-install-fnygoose/pyodbc_7db1b044e510447c8352fe2f54d4cbe0/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-w_eqzv_4/install-record.txt --single-version-externally-managed --compile --install-headers /app/python3.7.4/include/python3.7m/pyodbc
cwd: /tmp/pip-install-fnygoose/pyodbc_7db1b044e510447c8352fe2f54d4cbe0/
Complete output (10 lines):
running install
running build
running build_ext
building 'pyodbc' extension
creating build
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/src
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPYODBC_VERSION=4.0.30 -I/app/python3.7.4/include/python3.7m -c src/buffer.cpp -o build/temp.linux-x86_64-3.7/src/buffer.o -Wno-write-strings
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-fnygoose/pyodbc_7db1b044e510447c8352fe2f54d4cbe0/setup.py'"'"'; __file__='"'"'/tmp/pip-install-fnygoose/pyodbc_7db1b044e510447c8352fe2f54d4cbe0/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-w_eqzv_4/install-record.txt --single-version-externally-managed --compile --install-headers /app/python3.7.4/include/python3.7m/pyodbc Check the logs for full command output.

You need to install the first dependency.
!apt install unixodbc-dev --yes
!pip install pyodbc

Related

PyAudio won't install: "fatal error: 'portaudio.h' file not found"

I have been trying to install PyAudio but I can't.
I have tried the Homebrew method and the Xcode method:
xcode-select --install
brew remove portaudio
brew install portaudio
pip3 install pyaudio
I even tried this command
pip install --global-option='build_ext' --global-option='-I/usr/local/include' --global-option='-L/usr/local/lib' pyaudio
I also tried
pip3 install pyaudio
and
pip install pyaudio
I keep getting this error
/Users/firassyed/opt/anaconda3/envs/env_pytorch/lib/python3.6/site-packages/pip/_internal/commands/install.py:245: UserWarning: Disabling all use of wheels due to the use of --build-option / --global-option / --install-option.
cmdoptions.check_install_build_global(options)
Collecting pyaudio
Using cached PyAudio-0.2.11.tar.gz (37 kB)
Preparing metadata (setup.py) ... done
Skipping wheel build for pyaudio, due to binaries being disabled for it.
Installing collected packages: pyaudio
Running setup.py install for pyaudio ... error
ERROR: Command errored out with exit status 1:
command: /Users/firassyed/opt/anaconda3/envs/env_pytorch/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/j0/5j_xyczd6ddc5z2hm8wsbpwr0000gn/T/pip-install-pbxf5s_a/pyaudio_3976f98c4d7440d3bbb5800ecc3b675d/setup.py'"'"'; __file__='"'"'/private/var/folders/j0/5j_xyczd6ddc5z2hm8wsbpwr0000gn/T/pip-install-pbxf5s_a/pyaudio_3976f98c4d7440d3bbb5800ecc3b675d/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' build_ext -I/usr/local/include -L/usr/local/lib install --record /private/var/folders/j0/5j_xyczd6ddc5z2hm8wsbpwr0000gn/T/pip-record-i_lptc1z/install-record.txt --single-version-externally-managed --compile --install-headers /Users/firassyed/opt/anaconda3/envs/env_pytorch/include/python3.6m/pyaudio
cwd: /private/var/folders/j0/5j_xyczd6ddc5z2hm8wsbpwr0000gn/T/pip-install-pbxf5s_a/pyaudio_3976f98c4d7440d3bbb5800ecc3b675d/
Complete output (11 lines):
running build_ext
building '_portaudio' extension
creating build
creating build/temp.macosx-10.9-x86_64-3.6
creating build/temp.macosx-10.9-x86_64-3.6/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/firassyed/opt/anaconda3/envs/env_pytorch/include -arch x86_64 -I/Users/firassyed/opt/anaconda3/envs/env_pytorch/include -arch x86_64 -DMACOSX=1 -I/usr/local/include -I/Users/firassyed/opt/anaconda3/envs/env_pytorch/include/python3.6m -c src/_portaudiomodule.c -o build/temp.macosx-10.9-x86_64-3.6/src/_portaudiomodule.o
src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found
#include "portaudio.h"
^~~~~~~~~~~~~
1 error generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Users/firassyed/opt/anaconda3/envs/env_pytorch/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/j0/5j_xyczd6ddc5z2hm8wsbpwr0000gn/T/pip-install-pbxf5s_a/pyaudio_3976f98c4d7440d3bbb5800ecc3b675d/setup.py'"'"'; __file__='"'"'/private/var/folders/j0/5j_xyczd6ddc5z2hm8wsbpwr0000gn/T/pip-install-pbxf5s_a/pyaudio_3976f98c4d7440d3bbb5800ecc3b675d/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' build_ext -I/usr/local/include -L/usr/local/lib install --record /private/var/folders/j0/5j_xyczd6ddc5z2hm8wsbpwr0000gn/T/pip-record-i_lptc1z/install-record.txt --single-version-externally-managed --compile --install-headers /Users/firassyed/opt/anaconda3/envs/env_pytorch/include/python3.6m/pyaudio Check the logs for full command output.
Collecting pyaudio
Using cached PyAudio-0.2.11.tar.gz (37 kB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: pyaudio
Building wheel for pyaudio (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /Users/firassyed/opt/anaconda3/envs/env_pytorch/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/j0/5j_xyczd6ddc5z2hm8wsbpwr0000gn/T/pip-install-ozic18ff/pyaudio_0f1cab72b9cf407cb344f0b0fc90d0e4/setup.py'"'"'; __file__='"'"'/private/var/folders/j0/5j_xyczd6ddc5z2hm8wsbpwr0000gn/T/pip-install-ozic18ff/pyaudio_0f1cab72b9cf407cb344f0b0fc90d0e4/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/j0/5j_xyczd6ddc5z2hm8wsbpwr0000gn/T/pip-wheel-rw8wdejj
cwd: /private/var/folders/j0/5j_xyczd6ddc5z2hm8wsbpwr0000gn/T/pip-install-ozic18ff/pyaudio_0f1cab72b9cf407cb344f0b0fc90d0e4/
Complete output (16 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.6
copying src/pyaudio.py -> build/lib.macosx-10.9-x86_64-3.6
running build_ext
building '_portaudio' extension
creating build/temp.macosx-10.9-x86_64-3.6
creating build/temp.macosx-10.9-x86_64-3.6/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/firassyed/opt/anaconda3/envs/env_pytorch/include -arch x86_64 -I/Users/firassyed/opt/anaconda3/envs/env_pytorch/include -arch x86_64 -DMACOSX=1 -I/Users/firassyed/opt/anaconda3/envs/env_pytorch/include/python3.6m -c src/_portaudiomodule.c -o build/temp.macosx-10.9-x86_64-3.6/src/_portaudiomodule.o
src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found
#include "portaudio.h"
^~~~~~~~~~~~~
1 error generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for pyaudio
Running setup.py clean for pyaudio
Failed to build pyaudio
Installing collected packages: pyaudio
Running setup.py install for pyaudio ... error
ERROR: Command errored out with exit status 1:
command: /Users/firassyed/opt/anaconda3/envs/env_pytorch/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/j0/5j_xyczd6ddc5z2hm8wsbpwr0000gn/T/pip-install-ozic18ff/pyaudio_0f1cab72b9cf407cb344f0b0fc90d0e4/setup.py'"'"'; __file__='"'"'/private/var/folders/j0/5j_xyczd6ddc5z2hm8wsbpwr0000gn/T/pip-install-ozic18ff/pyaudio_0f1cab72b9cf407cb344f0b0fc90d0e4/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/j0/5j_xyczd6ddc5z2hm8wsbpwr0000gn/T/pip-record-9pe8tglt/install-record.txt --single-version-externally-managed --compile --install-headers /Users/firassyed/opt/anaconda3/envs/env_pytorch/include/python3.6m/pyaudio
cwd: /private/var/folders/j0/5j_xyczd6ddc5z2hm8wsbpwr0000gn/T/pip-install-ozic18ff/pyaudio_0f1cab72b9cf407cb344f0b0fc90d0e4/
Complete output (18 lines):
running install
/Users/firassyed/opt/anaconda3/envs/env_pytorch/lib/python3.6/site-packages/setuptools/command/install.py:37: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
setuptools.SetuptoolsDeprecationWarning,
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.6
copying src/pyaudio.py -> build/lib.macosx-10.9-x86_64-3.6
running build_ext
building '_portaudio' extension
creating build/temp.macosx-10.9-x86_64-3.6
creating build/temp.macosx-10.9-x86_64-3.6/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/firassyed/opt/anaconda3/envs/env_pytorch/include -arch x86_64 -I/Users/firassyed/opt/anaconda3/envs/env_pytorch/include -arch x86_64 -DMACOSX=1 -I/Users/firassyed/opt/anaconda3/envs/env_pytorch/include/python3.6m -c src/_portaudiomodule.c -o build/temp.macosx-10.9-x86_64-3.6/src/_portaudiomodule.o
src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found
#include "portaudio.h"
^~~~~~~~~~~~~
1 error generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Users/firassyed/opt/anaconda3/envs/env_pytorch/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/j0/5j_xyczd6ddc5z2hm8wsbpwr0000gn/T/pip-install-ozic18ff/pyaudio_0f1cab72b9cf407cb344f0b0fc90d0e4/setup.py'"'"'; __file__='"'"'/private/var/folders/j0/5j_xyczd6ddc5z2hm8wsbpwr0000gn/T/pip-install-ozic18ff/pyaudio_0f1cab72b9cf407cb344f0b0fc90d0e4/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/j0/5j_xyczd6ddc5z2hm8wsbpwr0000gn/T/pip-record-9pe8tglt/install-record.txt --single-version-externally-managed --compile --install-headers /Users/firassyed/opt/anaconda3/envs/env_pytorch/include/python3.6m/pyaudio Check the logs for full command output.
Try:
pip install pipwin
pipwin install pyaudio

Unable to install pyaudio on Ubuntu 21.04? [duplicate]

This question already has answers here:
fatal error: Python.h: No such file or directory
(35 answers)
Closed 1 year ago.
Within a python venv via terminal I have tried to install pyaudio using pip install pyaudio. I continue to get the following error:
Collecting pyaudio
Using cached PyAudio-0.2.11.tar.gz (37 kB)
Using legacy 'setup.py install' for pyaudio, since package 'wheel' is not installed.
Installing collected packages: pyaudio
Running setup.py install for pyaudio ... error
ERROR: Command errored out with exit status 1:
command: /home/user/Documents/Dev/jarvis/venv/bin/python3.9 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-n_fu8__5/pyaudio_a1072b1cc7344f699b51f2cf840e0e1f/setup.py'"'"'; __file__='"'"'/tmp/pip-install-n_fu8__5/pyaudio_a1072b1cc7344f699b51f2cf840e0e1f/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-mnx7j3d4/install-record.txt --single-version-externally-managed --compile --install-headers /home/user/Documents/Dev/jarvis/venv/include/site/python3.9/pyaudio
cwd: /tmp/pip-install-n_fu8__5/pyaudio_a1072b1cc7344f699b51f2cf840e0e1f/
Complete output (16 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.9
copying src/pyaudio.py -> build/lib.linux-x86_64-3.9
running build_ext
building '_portaudio' extension
creating build/temp.linux-x86_64-3.9
creating build/temp.linux-x86_64-3.9/src
x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/build/python3.9-1n6GrT/python3.9-3.9.5=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -ffile-prefix-map=/build/python3.9-1n6GrT/python3.9-3.9.5=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/home/user/Documents/Dev/jarvis/venv/include -I/usr/include/python3.9 -c src/_portaudiomodule.c -o build/temp.linux-x86_64-3.9/src/_portaudiomodule.o
src/_portaudiomodule.c:28:10: fatal error: Python.h: No such file or directory
28 | #include "Python.h"
| ^~~~~~~~~~
compilation terminated.
error: command '/usr/bin/x86_64-linux-gnu-gcc' failed with exit code 1
----------------------------------------
ERROR: Command errored out with exit status 1: /home/user/Documents/Dev/jarvis/venv/bin/python3.9 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-n_fu8__5/pyaudio_a1072b1cc7344f699b51f2cf840e0e1f/setup.py'"'"'; __file__='"'"'/tmp/pip-install-n_fu8__5/pyaudio_a1072b1cc7344f699b51f2cf840e0e1f/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-mnx7j3d4/install-record.txt --single-version-externally-managed --compile --install-headers /home/user/Documents/Dev/jarvis/venv/include/site/python3.9/pyaudio Check the logs for full command output.
Try pip install wheel in your terminal and try installing pyaudio again

I can't install PyAudio on Mac

Here is the terminal line:
pip install pyaudio
Collecting pyaudio
Using cached PyAudio-0.2.11.tar.gz (37 kB)
Using legacy 'setup.py install' for pyaudio, since package 'wheel' is not installed.
Installing collected packages: pyaudio
Running setup.py install for pyaudio ... error
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/mt/2rtm41zn26x_6nxfh29s9g9w0000gn/T/pip-install-vnh5uil7/pyaudio/setup.py'"'"'; __file__='"'"'/private/var/folders/mt/2rtm41zn26x_6nxfh29s9g9w0000gn/T/pip-install-vnh5uil7/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 /private/var/folders/mt/2rtm41zn26x_6nxfh29s9g9w0000gn/T/pip-record-53bfxokf/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.8/include/python3.8/pyaudio
cwd: /private/var/folders/mt/2rtm41zn26x_6nxfh29s9g9w0000gn/T/pip-install-vnh5uil7/pyaudio/
Complete output (13 lines):
running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.8
copying src/pyaudio.py -> build/lib.macosx-10.9-x86_64-3.8
running build_ext
building '_portaudio' extension
creating build/temp.macosx-10.9-x86_64-3.8
creating build/temp.macosx-10.9-x86_64-3.8/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g -DMACOSX=1 -I/Library/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c src/_portaudiomodule.c -o build/temp.macosx-10.9-x86_64-3.8/src/_portaudiomodule.o
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/mt/2rtm41zn26x_6nxfh29s9g9w0000gn/T/pip-install-vnh5uil7/pyaudio/setup.py'"'"'; __file__='"'"'/private/var/folders/mt/2rtm41zn26x_6nxfh29s9g9w0000gn/T/pip-install-vnh5uil7/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 /private/var/folders/mt/2rtm41zn26x_6nxfh29s9g9w0000gn/T/pip-record-53bfxokf/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.8/include/python3.8/pyaudio Check the logs for full command output.
I installed port audio from brew.
Here is a thread that hopefully will help you out:
--> Pyaudio installation error - 'command 'gcc' failed with exit status 1'

Cant install PyAudio python3.8

I have kali linux, amd64, last python3.8 version, and when i am trying to install pyaudio i get just this ERROR: Failed building wheel for PyAudio Running setup.py clean for PyAudio Failed to build PyAudio Installing collected packages: PyAudio Running setup.py install for PyAudio ... error ERROR: Command errored out with exit status 1: command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-l87_4qp_/PyAudio/setup.py'"'"'; __file__='"'"'/tmp/pip-install-l87_4qp_/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 /tmp/pip-record-2u86ewfj/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/PyAudio cwd: /tmp/pip-install-l87_4qp_/PyAudio/ Complete output (16 lines): running install running build running build_py creating build creating build/lib.linux-x86_64-3.8 copying src/pyaudio.py -> build/lib.linux-x86_64-3.8 running build_ext building '_portaudio' extension creating build/temp.linux-x86_64-3.8 creating build/temp.linux-x86_64-3.8/src x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include/python3.8 -c src/_portaudiomodule.c -o build/temp.linux-x86_64-3.8/src/_portaudiomodule.o src/_portaudiomodule.c:29:10: fatal error: portaudio.h: Нет такого файла или каталога 29 | #include "portaudio.h" | ^~~~~~~~~~~~~ compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 ---------------------------------------- ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-l87_4qp_/PyAudio/setup.py'"'"'; __file__='"'"'/tmp/pip-install-l87_4qp_/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 /tmp/pip-record-2u86ewfj/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/PyAudio Check the logs for full command output
Idk what to do with that
I solved it by installing portaudio19-dev

Failed to Deploy to Heroku Platform

I am creating a html web form, from which I want the data to be stored into the local machine. While running the program it works fine on my local machine.
When I push the program to Heroku platform it fails.
----main file
-------Procfile
-------requirements.txt
-------runtime.txt
-------main.py
-------static
----templates
------index.html
----static
------index_css.css
Procfile:
web: gunicorn main:app
Requirements:
flask==1.1.1
flask-mysqldb==0.2.0
gunicorn==19.9.0
pyodbc==4.0.30
Runtime:
python-3.7.2
Error While Deploying it on Heroku PLatform:
Building wheel for pyodbc (setup.py): started
Building wheel for pyodbc (setup.py): finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /app/.heroku/python/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-q2igx1jr/pyodbc/setup.py'"'"'; __file__='"'"'/tmp/pip-install-q2igx1jr/pyodbc/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 /tmp/pip-wheel-8r1wqs6z
cwd: /tmp/pip-install-q2igx1jr/pyodbc/
Complete output (16 lines):
/app/.heroku/python/lib/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'long_description_content_type'
warnings.warn(msg)
running bdist_wheel
running build
running build_ext
building 'pyodbc' extension
creating build
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/src
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPYODBC_VERSION=4.0.30 -I/app/.heroku/python/include/python3.7m -c src/buffer.cpp -o build/temp.linux-x86_64-3.7/src/buffer.o -Wno-write-strings
In file included from src/buffer.cpp:12:0:
src/pyodbc.h:56:10: fatal error: sql.h: No such file or directory
#include <sql.h>
^~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for pyodbc
Running setup.py clean for pyodbc
Building wheel for mysqlclient (setup.py): started
Building wheel for mysqlclient (setup.py): finished with status 'done'
Created wheel for mysqlclient: filename=mysqlclient-2.0.0-cp37-cp37m-linux_x86_64.whl size=100868 sha256=ffd0776f2d39a5405cc1ac1465a08f48ee9da558c172105866f17378a6edebbd
Stored in directory: /tmp/pip-ephem-wheel-cache-5xsag9fy/wheels/80/87/ff/4ea9d03e0a265ef3a4a0cdf0cf1e4786c37665c4015b2ece83
Successfully built flask-mysqldb mysqlclient
Failed to build pyodbc
Installing collected packages: Werkzeug, click, itsdangerous, MarkupSafe, Jinja2, flask, mysqlclient, flask-mysqldb, gunicorn, pyodbc
Running setup.py install for pyodbc: started
Running setup.py install for pyodbc: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /app/.heroku/python/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-q2igx1jr/pyodbc/setup.py'"'"'; __file__='"'"'/tmp/pip-install-q2igx1jr/pyodbc/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-oz00635z/install-record.txt --single-version-externally-managed --compile --install-headers /app/.heroku/python/include/python3.7m/pyodbc
cwd: /tmp/pip-install-q2igx1jr/pyodbc/
Complete output (16 lines):
/app/.heroku/python/lib/python3.7/distutils/dist.py:274: UserWarning: Unknown distribution option: 'long_description_content_type'
warnings.warn(msg)
running install
running build
running build_ext
building 'pyodbc' extension
creating build
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/src
gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -fPIC -DPYODBC_VERSION=4.0.30 -I/app/.heroku/python/include/python3.7m -c src/buffer.cpp -o build/temp.linux-x86_64-3.7/src/buffer.o -Wno-write-strings
In file included from src/buffer.cpp:12:0:
src/pyodbc.h:56:10: fatal error: sql.h: No such file or directory
#include <sql.h>
^~~~~~~
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /app/.heroku/python/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-q2igx1jr/pyodbc/setup.py'"'"'; __file__='"'"'/tmp/pip-install-q2igx1jr/pyodbc/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-oz00635z/install-record.txt --single-version-externally-managed --compile --install-headers /app/.heroku/python/include/python3.7m/pyodbc Check the logs for full command output.
Push rejected, failed to compile Python app.
Push failed
I am fairly new to Heroku and I don't know how to solve this error.
in Procfile you can change:
web: gunicorn main.wsgi

Categories