Can't install sasl package in Ubuntu 18 - python

I want to install pyHive package in ubuntu. Using this step:-
sudo apt-get install gcc
sudo apt-get install libsasl2-dev
pip install sasl
pip install thrift
pip install thrift-sasl
pip install PyHive
but when i install sasl package it's given me error
Using cached sasl-0.2.1.tar.gz (30 kB)
Requirement already satisfied: six in /home/shivam_gupta/Documents/pip3-venv/lib/python3.7/site-packages (from sasl) (1.14.0)
Installing collected packages: sasl
Running setup.py install for sasl ... error
ERROR: Command errored out with exit status 1:
command: /home/shivam_gupta/Documents/pip3-venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-vokx0cvb/sasl/setup.py'"'"'; __file__='"'"'/tmp/pip-install-vokx0cvb/sasl/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-hqi5nw58/install-record.txt --single-version-externally-managed --compile --install-headers /home/shivam_gupta/Documents/pip3-venv/include/site/python3.7/sasl
cwd: /tmp/pip-install-vokx0cvb/sasl/
Complete output (32 lines):
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.7
creating build/lib.linux-x86_64-3.7/sasl
copying sasl/__init__.py -> build/lib.linux-x86_64-3.7/sasl
running egg_info
writing sasl.egg-info/PKG-INFO
writing dependency_links to sasl.egg-info/dependency_links.txt
writing requirements to sasl.egg-info/requires.txt
writing top-level names to sasl.egg-info/top_level.txt
reading manifest file 'sasl.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'sasl.egg-info/SOURCES.txt'
copying sasl/saslwrapper.cpp -> build/lib.linux-x86_64-3.7/sasl
copying sasl/saslwrapper.h -> build/lib.linux-x86_64-3.7/sasl
copying sasl/saslwrapper.pyx -> build/lib.linux-x86_64-3.7/sasl
running build_ext
building 'sasl.saslwrapper' extension
creating build/temp.linux-x86_64-3.7
creating build/temp.linux-x86_64-3.7/sasl
gcc -pthread -B /home/shivam_gupta/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -Isasl -I/home/shivam_gupta/Documents/pip3-venv/include -I/home/shivam_gupta/anaconda3/include/python3.7m -c sasl/saslwrapper.cpp -o build/temp.linux-x86_64-3.7/sasl/saslwrapper.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
In file included from sasl/saslwrapper.cpp:254:0:
sasl/saslwrapper.h: In member function ‘void saslwrapper::ClientImpl::interact(sasl_interact_t*)’:
sasl/saslwrapper.h:437:11: warning: unused variable ‘input’ [-Wunused-variable]
char* input;
^~~~~
g++ -pthread -shared -B /home/shivam_gupta/anaconda3/compiler_compat -L/home/shivam_gupta/anaconda3/lib -Wl,-rpath=/home/shivam_gupta/anaconda3/lib -Wl,--no-as-needed -Wl,--sysroot=/ build/temp.linux-x86_64-3.7/sasl/saslwrapper.o -lsasl2 -o build/lib.linux-x86_64-3.7/sasl/saslwrapper.cpython-37m-x86_64-linux-gnu.so
unable to execute 'g++': No such file or directory
error: command 'g++' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /home/shivam_gupta/Documents/pip3-venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-vokx0cvb/sasl/setup.py'"'"'; __file__='"'"'/tmp/pip-install-vokx0cvb/sasl/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-hqi5nw58/install-record.txt --single-version-externally-managed --compile --install-headers /home/shivam_gupta/Documents/pip3-venv/include/site/python3.7/sasl Check the logs for full command output.
My python version:- 3.7.6
What I do for installing hive in my ubuntu system?
And thrift-sasl also not installed.

unable to execute 'g++': No such file or directory
You don't have GNU C++ compiler. Install it:
sudo apt-get install g++

Related

I am trying to install pyaudio on Mac and getting the following error

% pip3 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.9/bin/python3.9 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/41/jq1tn1b113b6nmbmpqqfxhrr0000gn/T/pip-install-yuqomyva/pyaudio_df9e48fd3dc447b18c59302d7aac4fe2/setup.py'"'"'; file='"'"'/private/var/folders/41/jq1tn1b113b6nmbmpqqfxhrr0000gn/T/pip-install-yuqomyva/pyaudio_df9e48fd3dc447b18c59302d7aac4fe2/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/41/jq1tn1b113b6nmbmpqqfxhrr0000gn/T/pip-record-kg79q2az/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.9/include/python3.9/pyaudio
cwd: /private/var/folders/41/jq1tn1b113b6nmbmpqqfxhrr0000gn/T/pip-install-yuqomyva/pyaudio_df9e48fd3dc447b18c59302d7aac4fe2/
Complete output (16 lines):
running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.9
copying src/pyaudio.py -> build/lib.macosx-10.9-x86_64-3.9
running build_ext
building '_portaudio' extension
creating build/temp.macosx-10.9-x86_64-3.9
creating build/temp.macosx-10.9-x86_64-3.9/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.9/include/python3.9 -c src/_portaudiomodule.c -o build/temp.macosx-10.9-x86_64-3.9/src/_portaudiomodule.o
src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found
#include "portaudio.h"
^~~~~~~~~~~~~
1 error generated.
error: command '/usr/bin/gcc' failed with exit code 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Frameworks/Python.framework/Versions/3.9/bin/python3.9 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/41/jq1tn1b113b6nmbmpqqfxhrr0000gn/T/pip-install-yuqomyva/pyaudio_df9e48fd3dc447b18c59302d7aac4fe2/setup.py'"'"'; file='"'"'/private/var/folders/41/jq1tn1b113b6nmbmpqqfxhrr0000gn/T/pip-install-yuqomyva/pyaudio_df9e48fd3dc447b18c59302d7aac4fe2/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/41/jq1tn1b113b6nmbmpqqfxhrr0000gn/T/pip-record-kg79q2az/install-record.txt --single-version-externally-managed --compile --install-headers /Library/Frameworks/Python.framework/Versions/3.9/include/python3.9/pyaudio Check the logs for full command output.
Try:
pip install pipwin
And:
pipwin install pyaudio
Hope It Helps :D

Error While installing PyAudio in macOS: How can I fix this problem?

I was trying to install PyAudio
The system is macOS Mojave, and version of Python is 3.8
I think pip doesn't have any problem, but some frameworks are collided with pyaudio
here are error message shown.
What should I do?
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/hq/cp10yz710x51x0qsxlrj5s5m0000gn/T/pip-install-b7gmavn1/pyaudio/setup.py'"'"'; __file__='"'"'/private/var/folders/hq/cp10yz710x51x0qsxlrj5s5m0000gn/T/pip-install-b7gmavn1/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/hq/cp10yz710x51x0qsxlrj5s5m0000gn/T/pip-record-zz9o5bbq/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/hq/cp10yz710x51x0qsxlrj5s5m0000gn/T/pip-install-b7gmavn1/pyaudio/
Complete output (16 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
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: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/hq/cp10yz710x51x0qsxlrj5s5m0000gn/T/pip-install-b7gmavn1/pyaudio/setup.py'"'"'; __file__='"'"'/private/var/folders/hq/cp10yz710x51x0qsxlrj5s5m0000gn/T/pip-install-b7gmavn1/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/hq/cp10yz710x51x0qsxlrj5s5m0000gn/T/pip-record-zz9o5bbq/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.
Try installing pipwin first using:
pip install pipwin
and then install Pyaudio using pipwin:
pipwin install PyAudio

Can't install pyaudio at python 2.7 on MacOS

I typed: pip install pyaudio
and then it says:
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/wj/x_g39c7n4pn_mrmpq2m35b0c0000gn/T/pip-install-vpovlb7i/pyaudio/setup.py'"'"'; __file__='"'"'/private/var/folders/wj/x_g39c7n4pn_mrmpq2m35b0c0000gn/T/pip-install-vpovlb7i/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/wj/x_g39c7n4pn_mrmpq2m35b0c0000gn/T/pip-record-ek_hs7p1/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/wj/x_g39c7n4pn_mrmpq2m35b0c0000gn/T/pip-install-vpovlb7i/pyaudio/
Complete output (16 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
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: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/wj/x_g39c7n4pn_mrmpq2m35b0c0000gn/T/pip-install-vpovlb7i/pyaudio/setup.py'"'"'; __file__='"'"'/private/var/folders/wj/x_g39c7n4pn_mrmpq2m35b0c0000gn/T/pip-install-vpovlb7i/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/wj/x_g39c7n4pn_mrmpq2m35b0c0000gn/T/pip-record-ek_hs7p1/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.
WARNING: You are using pip version 20.1.1; however, version 20.2 is available.
You should consider upgrading via the '/Library/Frameworks/Python.framework/Versions/3.8/bin/python3.8 -m pip install --upgrade pip' command.
This is being installed under python3, So I would recommend you to run this under a virtual environment https://help.dreamhost.com/hc/en-us/articles/215489338-Installing-and-using-virtualenv-with-Python-2 , then try trying this back again while venv being activated

Compile errors installing REGEX in MacOS [duplicate]

This question already has an answer here:
Error on "pip install -U channels" command using for otree (Running setup.py bdist_wheel for twisted ... error)
(1 answer)
Closed 2 years ago.
I'm trying to install Regex on macos catalina, but I'm getting this error, how do I proceed? I tried to update pip, pip3, pipwin, xcode, but both return the same error, the same happens when I install NLTK.
I was able to install on a ubuntu VM and installed everything, REGEX and NLTK, only on MacOs that I continue with this error below:
pip3 install regex
Collecting regex
Using cached regex-2020.6.8.tar.gz (690 kB)
Building wheels for collected packages: regex
Building wheel for regex (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/local/opt/python/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/6h/wf23bbbj7t7dwhyzz0cjw3_r0000gn/T/pip-install-fzw0lg0t/regex/setup.py'"'"'; __file__='"'"'/private/var/folders/6h/wf23bbbj7t7dwhyzz0cjw3_r0000gn/T/pip-install-fzw0lg0t/regex/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 /private/var/folders/6h/wf23bbbj7t7dwhyzz0cjw3_r0000gn/T/pip-wheel-j6dr4ocd
cwd: /private/var/folders/6h/wf23bbbj7t7dwhyzz0cjw3_r0000gn/T/pip-install-fzw0lg0t/regex/
Complete output (17 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.14-x86_64-3.7
creating build/lib.macosx-10.14-x86_64-3.7/regex
copying regex_3/__init__.py -> build/lib.macosx-10.14-x86_64-3.7/regex
copying regex_3/regex.py -> build/lib.macosx-10.14-x86_64-3.7/regex
copying regex_3/_regex_core.py -> build/lib.macosx-10.14-x86_64-3.7/regex
copying regex_3/test_regex.py -> build/lib.macosx-10.14-x86_64-3.7/regex
running build_ext
building 'regex._regex' extension
creating build/temp.macosx-10.14-x86_64-3.7
creating build/temp.macosx-10.14-x86_64-3.7/regex_3
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/opt/openssl#1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c regex_3/_regex.c -o build/temp.macosx-10.14-x86_64-3.7/regex_3/_regex.o
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
error: command 'clang' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for regex
Running setup.py clean for regex
Failed to build regex
Installing collected packages: regex
Running setup.py install for regex ... error
ERROR: Command errored out with exit status 1:
command: /usr/local/opt/python/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/6h/wf23bbbj7t7dwhyzz0cjw3_r0000gn/T/pip-install-fzw0lg0t/regex/setup.py'"'"'; __file__='"'"'/private/var/folders/6h/wf23bbbj7t7dwhyzz0cjw3_r0000gn/T/pip-install-fzw0lg0t/regex/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/6h/wf23bbbj7t7dwhyzz0cjw3_r0000gn/T/pip-record-olfcxoeu/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.7m/regex
cwd: /private/var/folders/6h/wf23bbbj7t7dwhyzz0cjw3_r0000gn/T/pip-install-fzw0lg0t/regex/
Complete output (17 lines):
running install
running build
running build_py
creating build
creating build/lib.macosx-10.14-x86_64-3.7
creating build/lib.macosx-10.14-x86_64-3.7/regex
copying regex_3/__init__.py -> build/lib.macosx-10.14-x86_64-3.7/regex
copying regex_3/regex.py -> build/lib.macosx-10.14-x86_64-3.7/regex
copying regex_3/_regex_core.py -> build/lib.macosx-10.14-x86_64-3.7/regex
copying regex_3/test_regex.py -> build/lib.macosx-10.14-x86_64-3.7/regex
running build_ext
building 'regex._regex' extension
creating build/temp.macosx-10.14-x86_64-3.7
creating build/temp.macosx-10.14-x86_64-3.7/regex_3
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.14.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -I/usr/local/include -I/usr/local/opt/openssl#1.1/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c regex_3/_regex.c -o build/temp.macosx-10.14-x86_64-3.7/regex_3/_regex.o
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
error: command 'clang' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/opt/python/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/6h/wf23bbbj7t7dwhyzz0cjw3_r0000gn/T/pip-install-fzw0lg0t/regex/setup.py'"'"'; __file__='"'"'/private/var/folders/6h/wf23bbbj7t7dwhyzz0cjw3_r0000gn/T/pip-install-fzw0lg0t/regex/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/6h/wf23bbbj7t7dwhyzz0cjw3_r0000gn/T/pip-record-olfcxoeu/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.7m/regex Check the logs for full command output.**strong text**
I am no mac super user but you could try this and check if it works.
xcode-select --install
If it says it's already installed try:
xcode-select --reset
The reason I believe it might be the issue is cause of the xcrun error that is occurring.
The underlying error seems to be:
invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun`
You can most likely solve this by installing the command line tools:
xcode-select --install
See https://apple.stackexchange.com/questions/254380/why-am-i-getting-an-invalid-active-developer-path-when-attempting-to-use-git-a for more details.

Installing pyaudio with pip in a virtualenv

I'm trying to install pyaudio with pip:
pip install pyaudio
In a virtualenv but I'm getting an error:
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Entire output:
Collecting pyaudio
Using cached PyAudio-0.2.9.tar.gz
Building wheels for collected packages: pyaudio
Running setup.py bdist_wheel for pyaudio ... error
Complete output from command /home/mertyildiran/Downloads/VirtualEnvironment/vir1/Cerebrum/ENV/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-GCltlv/pyaudio/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d /tmp/tmpyR6J73pip-wheel- --python-tag cp27:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying src/pyaudio.py -> build/lib.linux-x86_64-2.7
running build_ext
building '_portaudio' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c src/_portaudiomodule.c -o build/temp.linux-x86_64-2.7/src/_portaudiomodule.o
src/_portaudiomodule.c:29:23: fatal error: portaudio.h: No such file or directory
#include "portaudio.h"
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
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
Complete output from command /home/mertyildiran/Downloads/VirtualEnvironment/vir1/Cerebrum/ENV/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-GCltlv/pyaudio/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-icMIUV-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/mertyildiran/Downloads/VirtualEnvironment/vir1/Cerebrum/ENV/include/site/python2.7/pyaudio:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
copying src/pyaudio.py -> build/lib.linux-x86_64-2.7
running build_ext
building '_portaudio' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/include/python2.7 -c src/_portaudiomodule.c -o build/temp.linux-x86_64-2.7/src/_portaudiomodule.o
src/_portaudiomodule.c:29:23: fatal error: portaudio.h: No such file or directory
#include "portaudio.h"
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/home/mertyildiran/Downloads/VirtualEnvironment/vir1/Cerebrum/ENV/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-GCltlv/pyaudio/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-icMIUV-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/mertyildiran/Downloads/VirtualEnvironment/vir1/Cerebrum/ENV/include/site/python2.7/pyaudio" failed with error code 1 in /tmp/pip-build-GCltlv/pyaudio
What am I doing wrong? I'm new in virtualenvs.
*I'm able to install other packages. I'm facing with an error only for pyaudio package.
By the way I'm in the environment:
(ENV) mertyildiran#Corsair:~/Downloads/VirtualEnvironment/vir1/MyProject$
This worked for me, I had the same problem:
if you want to install PyAudio inside a virtualenv, install the PortAudio development headers from APT, then PyAudio:
sudo apt-get install portaudio19-dev
pip install --allow-unverified=pyaudio pyaudio
https://pyspotify.mopidy.com/en/latest/api/sink/
Some packages require the support of non-Python software, such as shared libraries. These cannot be installed via pip (they're not Python packages!). You generally install these on the host using your host's package manager (apt-get or yum or dnf, etc...), or you use something like Docker to encapsulate both the dependencies and your application.
In your case, pyaudio requires a number of libraries, including at least portaudio. You will need to install the appropriate development packages on your system, as suggested in the comments on your question.
Following steps worked for me :) Please go through and try
1 sudo apt-get install libasound-dev
2 sudo apt-get install portaudio19-dev
3 pip install pyaudio --user
OR (--user dont work then try python3-pyaudio)
sudo apt-get install python3-pyaudio
In new Python 3.0 pyaudio can install in windows use following command:
pip3 install pyaudio.
If you want to install pyaudio in virtual environment in windows
first you need to download PyAudio-0.2.11-cp37-cp37m-win_amd64.whl this file in [https://www.lfd.uci.edu/~gohlke/pythonlibs/] here and then open command prompt and go to the path where your downloaded file located and type pip install PyAudio-0.2.11-cp37-cp37m-win_amd64.whl

Categories

Resources