Unable to install PyAudio in Python 3.9 (Windows, Ubuntu) - python-3.x

I'm trying to install PyAudio on Python 3.9. I am running Windows 10 and using an Ubuntu bash. I've tried both pip3 install and pip3 install pyasn‑1.6.0b1‑cp39‑cp39‑win_amd64.whl. The second being an attempt to use the unofficial 3.9 wheel from here.
This is what I get when I attempt pip3 install pyaudio:
Collecting pyaudio
Using cached PyAudio-0.2.11.tar.gz (37 kB)
Building wheels for collected packages: pyaudio
Building wheel for pyaudio (setup.py) ... 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-imufkwd7/pyaudio/setup.py'"'"'; __file__='"'"'/tmp/pip-install-imufkwd7/pyaudio/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-c2o57hhw
cwd: /tmp/pip-install-imufkwd7/pyaudio/
Complete output (16 lines):
running bdist_wheel
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: No such file or directory
29 | #include "portaudio.h"
| ^~~~~~~~~~~~~
compilation terminated.
error: command 'x86_64-linux-gnu-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: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-imufkwd7/pyaudio/setup.py'"'"'; __file__='"'"'/tmp/pip-install-imufkwd7/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-8vw48w5x/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/lukangel00/.local/include/python3.8/pyaudio
cwd: /tmp/pip-install-imufkwd7/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: No such file or directory
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-imufkwd7/pyaudio/setup.py'"'"'; __file__='"'"'/tmp/pip-install-imufkwd7/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-8vw48w5x/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/lukangel00/.local/include/python3.8/pyaudio Check the logs for full command output.
In the error message, I'm noticing a reference to Python 3.8, which I don't have. Is this part of the error?
And this is what I get when I attempt pip3 install pyasn‑1.6.0b1‑cp39‑cp39‑win_amd64.whl:
ERROR: PyAudio-0.2.11-cp39-cp39-win_amd64.whl is not a supported wheel on this platform.
I've checked, and I'm certain that I have x64 Python. I also tried a different version in case this one was buggy.
Any ideas?

Try installing python-dev
sudo apt-get install python-dev

sudo apt-get install libasound-dev portaudio19-dev libportaudio2 libportaudiocpp0
try the above snippet before running
pip install pyaudio
it worked for me
here are some sources I took this info in case you need it:
https://www.codegrepper.com/code-examples/python/how+to+install+pyaudio+in+ubuntu
https://ourcodeworld.com/articles/read/974/how-to-solve-installation-error-of-pyaudio-in-ubuntu-18-04-fatal-error-portaudio-h-file-not-found

Related

Error installing pandas_profiling with Pip on Ubuntu 20.04

pip install pandas_profiling
fails at
Running setup.py install for Bottleneck ... error
ERROR: Command errored out with exit status 1:
command: /home/me/venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-u7f_8_0k/bottleneck_1375337c49c246109b2e650965628211/setup.py'"'"'; file='"'"'/tmp/pip-install-u7f_8_0k/bottleneck_1375337c49c246109b2e650965628211/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 /tmp/pip-record-pgrmqqqd/install-record.txt --single-version-externally-managed --compile --install-headers /home/me/venv/include/site/python3.9/Bottleneck
cwd: /tmp/pip-install-u7f_8_0k/bottleneck_1375337c49c246109b2e650965628211/
Complete output (15 lines):
running install
running build
running build_py
running build_ext
building 'bottleneck.reduce' extension
creating build/temp.linux-x86_64-3.9
creating build/temp.linux-x86_64-3.9/bottleneck
creating build/temp.linux-x86_64-3.9/bottleneck/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/home/me/venv/lib/python3.9/site-packages/numpy/core/include -I/home/me/venv/include -I/usr/include/python3.9 -c bottleneck/src/reduce.c -o build/temp.linux-x86_64-3.9/bottleneck/src/reduce.o -O2
In file included from bottleneck/src/reduce.c:1:
bottleneck/src/bottleneck.h:4:10: fatal error: Python.h: No such file or directory
4 | #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/me/venv/bin/python -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-u7f_8_0k/bottleneck_1375337c49c246109b2e650965628211/setup.py'"'"'; file='"'"'/tmp/pip-install-u7f_8_0k/bottleneck_1375337c49c246109b2e650965628211/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 /tmp/pip-record-pgrmqqqd/install-record.txt --single-version-externally-managed --compile --install-headers /home/me/venv/include/site/python3.9/Bottleneck Check the logs for full command output.
I am on Ubuntu 20.04 and my python version is-
Python 3.9.0+
I tried installing Bottleneck separately,
pip install Bottleneck --no-cache-dir
but that also gives the same error. Have looked solutions to related topics,
fatal error: Python.h: No such file or directory
setup script exited with error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Failed building wheel for bottleneck error
but no luck. Any help would be appreciated.
So.. finally this is what made it work... had to install python3.9-dev.

pyaudio installation error ( #include <stdio.h> command 'clang' failed with exit status 1)

I'm trying to install pyaudio in mac having python 64 bit, using the command "pip3 install pyaudio", by getting the below error.
Installing collected packages: pyaudio
Running setup.py install for pyaudio ... error
ERROR: Command errored out with exit status 1:
command: '/Users/sambitkumar/Documents/Learn/Python Packages/speech/venv/bin/python3' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/kr/jr2wrc015pz1clvbqvwr1lhh0000gn/T/pip-install-sq4k9xkw/pyaudio/setup.py'"'"'; __file__='"'"'/private/var/folders/kr/jr2wrc015pz1clvbqvwr1lhh0000gn/T/pip-install-sq4k9xkw/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/kr/jr2wrc015pz1clvbqvwr1lhh0000gn/T/pip-record-0v8uniq2/install-record.txt --single-version-externally-managed --compile --install-headers '/Users/sambitkumar/Documents/Learn/Python Packages/speech/venv/include/site/python3.7/pyaudio'
cwd: /private/var/folders/kr/jr2wrc015pz1clvbqvwr1lhh0000gn/T/pip-install-sq4k9xkw/pyaudio/
Complete output (16 lines):
running install
running build
running build_py
creating build
creating build/lib.macosx-10.15-x86_64-3.7
copying src/pyaudio.py -> build/lib.macosx-10.15-x86_64-3.7
running build_ext
building '_portaudio' extension
creating build/temp.macosx-10.15-x86_64-3.7
creating build/temp.macosx-10.15-x86_64-3.7/src
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Tk.framework/Versions/8.5/Headers -DMACOSX=1 -I/usr/local/include -I/usr/local/opt/openssl#1.1/include -I/usr/local/opt/sqlite/include -I/Users/sambitkumar/Documents/Learn/Python Packages/speech/venv/include -I/usr/local/Cellar/python/3.7.7/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c src/_portaudiomodule.c -o build/temp.macosx-10.15-x86_64-3.7/src/_portaudiomodule.o
src/_portaudiomodule.c:27:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
^~~~~~~~~
1 error generated.
error: command 'clang' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: '/Users/sambitkumar/Documents/Learn/Python Packages/speech/venv/bin/python3' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/kr/jr2wrc015pz1clvbqvwr1lhh0000gn/T/pip-install-sq4k9xkw/pyaudio/setup.py'"'"'; __file__='"'"'/private/var/folders/kr/jr2wrc015pz1clvbqvwr1lhh0000gn/T/pip-install-sq4k9xkw/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/kr/jr2wrc015pz1clvbqvwr1lhh0000gn/T/pip-record-0v8uniq2/install-record.txt --single-version-externally-managed --compile --install-headers '/Users/sambitkumar/Documents/Learn/Python Packages/speech/venv/include/site/python3.7/pyaudio' Check the logs for full command output.
I tried the below solutions but none of them could help me in installing the package successfully.
brew install portaudio (It's already installed)
pip install --global-option='build_ext' --global-option='-I/usr/local/include' --global-option='-L/usr/local/lib' pyaudio (same error as mentioned above)
xcode-select --install (It fails saying this is either already installed or not required any more.)
Any suggestion to install the package successfully?

`pip3 install batman-package` not working

Using macOS 10.15.6, I have installed python3 (3.8.5) through homebrew (2.4.9). Then I have installed the packages I needed using pip3 (20.2).
But I am having an issue when I want to install a python module called "batman".
I first installed it using pip3 install batman, but then I saw that the correct way was to do pip3 install batman-package, except that doing so gives me a long error message that I tried to understand, however I have not managed to understand what I needed to fix, so I am asking if anyone has a way to fix this?
Thanks
Collecting batman-package
Using cached batman-package-2.4.6.tar.gz (29 kB)
Requirement already satisfied: numpy in /usr/local/lib/python3.8/site-packages (from batman-package) (1.19.0)
Building wheels for collected packages: batman-package
Building wheel for batman-package (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /usr/local/opt/python#3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/lm/_dqfmk_10034g3h8k09n7vsr01ncqx/T/pip-install-2xfl5s0z/batman-package/setup.py'"'"'; __file__='"'"'/private/var/folders/lm/_dqfmk_10034g3h8k09n7vsr01ncqx/T/pip-install-2xfl5s0z/batman-package/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/lm/_dqfmk_10034g3h8k09n7vsr01ncqx/T/pip-wheel-9fvrwe2s
cwd: /private/var/folders/lm/_dqfmk_10034g3h8k09n7vsr01ncqx/T/pip-install-2xfl5s0z/batman-package/
Complete output (25 lines):
Checking for OpenMP support...
Did not detect OpenMP support.
/usr/local/Cellar/python#3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py:274: UserWarning: Unknown distribution option: 'extras_requires'
warnings.warn(msg)
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.15-x86_64-3.8
creating build/lib.macosx-10.15-x86_64-3.8/batman
copying batman/openmp.py -> build/lib.macosx-10.15-x86_64-3.8/batman
copying batman/transitmodel.py -> build/lib.macosx-10.15-x86_64-3.8/batman
copying batman/__init__.py -> build/lib.macosx-10.15-x86_64-3.8/batman
copying batman/plots.py -> build/lib.macosx-10.15-x86_64-3.8/batman
copying batman/tests.py -> build/lib.macosx-10.15-x86_64-3.8/batman
running build_ext
building 'batman._nonlinear_ld' extension
creating build/temp.macosx-10.15-x86_64-3.8
creating build/temp.macosx-10.15-x86_64-3.8/c_src
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.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.8/3.8.5/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c c_src/_nonlinear_ld.c -o build/temp.macosx-10.15-x86_64-3.8/c_src/_nonlinear_ld.o -std=c99
c_src/_nonlinear_ld.c:21:10: fatal error: 'numpy/arrayobject.h' file not found
#include "numpy/arrayobject.h"
^~~~~~~~~~~~~~~~~~~~~
1 error generated.
error: command 'clang' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for batman-package
Running setup.py clean for batman-package
Failed to build batman-package
DEPRECATION: Could not build wheels for batman-package which do not use PEP 517. pip will fall back to legacy 'setup.py install' for these. pip 21.0 will remove support for this functionality. A possible replacement is to fix the wheel build issue reported above. You can find discussion regarding this at https://github.com/pypa/pip/issues/8368.
Installing collected packages: batman-package
Running setup.py install for batman-package ... error
ERROR: Command errored out with exit status 1:
command: /usr/local/opt/python#3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/lm/_dqfmk_10034g3h8k09n7vsr01ncqx/T/pip-install-2xfl5s0z/batman-package/setup.py'"'"'; __file__='"'"'/private/var/folders/lm/_dqfmk_10034g3h8k09n7vsr01ncqx/T/pip-install-2xfl5s0z/batman-package/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/lm/_dqfmk_10034g3h8k09n7vsr01ncqx/T/pip-record-a9qct8l8/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/batman-package
cwd: /private/var/folders/lm/_dqfmk_10034g3h8k09n7vsr01ncqx/T/pip-install-2xfl5s0z/batman-package/
Complete output (25 lines):
Checking for OpenMP support...
Did not detect OpenMP support.
/usr/local/Cellar/python#3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/distutils/dist.py:274: UserWarning: Unknown distribution option: 'extras_requires'
warnings.warn(msg)
running install
running build
running build_py
creating build
creating build/lib.macosx-10.15-x86_64-3.8
creating build/lib.macosx-10.15-x86_64-3.8/batman
copying batman/openmp.py -> build/lib.macosx-10.15-x86_64-3.8/batman
copying batman/transitmodel.py -> build/lib.macosx-10.15-x86_64-3.8/batman
copying batman/__init__.py -> build/lib.macosx-10.15-x86_64-3.8/batman
copying batman/plots.py -> build/lib.macosx-10.15-x86_64-3.8/batman
copying batman/tests.py -> build/lib.macosx-10.15-x86_64-3.8/batman
running build_ext
building 'batman._nonlinear_ld' extension
creating build/temp.macosx-10.15-x86_64-3.8
creating build/temp.macosx-10.15-x86_64-3.8/c_src
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include -I/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.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.8/3.8.5/Frameworks/Python.framework/Versions/3.8/include/python3.8 -c c_src/_nonlinear_ld.c -o build/temp.macosx-10.15-x86_64-3.8/c_src/_nonlinear_ld.o -std=c99
c_src/_nonlinear_ld.c:21:10: fatal error: 'numpy/arrayobject.h' file not found
#include "numpy/arrayobject.h"
^~~~~~~~~~~~~~~~~~~~~
1 error generated.
error: command 'clang' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/opt/python#3.8/bin/python3.8 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/lm/_dqfmk_10034g3h8k09n7vsr01ncqx/T/pip-install-2xfl5s0z/batman-package/setup.py'"'"'; __file__='"'"'/private/var/folders/lm/_dqfmk_10034g3h8k09n7vsr01ncqx/T/pip-install-2xfl5s0z/batman-package/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/lm/_dqfmk_10034g3h8k09n7vsr01ncqx/T/pip-record-a9qct8l8/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/batman-package Check the logs for full command output.
Ok so it was actually a problem with headers as thilina lakshan said. I followed the link he posted and indeed by running export CFLAGS="-I /usr/local/lib/python3.8/site-packages/numpy/core/include $CFLAGS" in the terminal worked and I could install the package.
Thank you very very much!

Getting Errors while installing airflow using pip install apache-airflow in macOS Catalina

I am steering my learning wheel towards airflow during this weekend and while setting up and installing airflow at local machine using pip install apache-airflow, I'm getting following errors:
(base) ItGuy-MacBook-Pro:~ gofrogs$ pip install apache-airflow
Stored in directory: /Users/gofrogs/Library/Caches/pip/wheels/41/d4/fa/31df9cc56ee41572a4dfc1be7dfc87df59a5d6a7fd03e97eab
Building wheel for setproctitle (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /Users/gofrogs/Downloads/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/7s/9jm62xrs77x3mvsjfkd_7fq80000gn/T/pip-install-hnedol5a/setproctitle/setup.py'"'"'; __file__='"'"'/private/var/folders/7s/9jm62xrs77x3mvsjfkd_7fq80000gn/T/pip-install-hnedol5a/setproctitle/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/7s/9jm62xrs77x3mvsjfkd_7fq80000gn/T/pip-wheel-78zrb1fy
cwd: /private/var/folders/7s/9jm62xrs77x3mvsjfkd_7fq80000gn/T/pip-install-hnedol5a/setproctitle/
Complete output (10 lines):
running bdist_wheel
running build
running build_ext
building 'setproctitle' extension
creating build
creating build/temp.macosx-10.9-x86_64-3.7
creating build/temp.macosx-10.9-x86_64-3.7/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/gofrogs/Downloads/anaconda3/include -arch x86_64 -I/Users/gofrogs/Downloads/anaconda3/include -arch x86_64 -DSPT_VERSION=1.1.10 -D__darwin__=1 -I/Users/gofrogs/Downloads/anaconda3/include/python3.7m -c src/setproctitle.c -o build/temp.macosx-10.9-x86_64-3.7/src/setproctitle.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: Failed building wheel for setproctitle
and
Successfully built thrift flask-admin termcolor alembic dill pendulum flask-login flask-swagger json-merge-patch tzlocal Flask-JWT-Extended sqlalchemy-utils Flask-OpenID
Failed to build setproctitle
Installing collected packages: thrift, flask-caching, cached-property, wtforms, flask-admin, lockfile, python-daemon, tabulate, configparser, markdown, sqlalchemy-jsonfield, text-unidecode, termcolor, python-editor, Mako, alembic, dill, attrs, pytzdata, tzlocal, pendulum, argcomplete, setproctitle, PyJWT, Flask-JWT-Extended, marshmallow, flask-wtf, Flask-Babel, marshmallow-enum, Flask-SQLAlchemy, prison, flask-login, sqlalchemy-utils, apispec, marshmallow-sqlalchemy, python3-openid, Flask-OpenID, flask-appbuilder, cattrs, colorlog, graphviz, typing-extensions, croniter, flask-swagger, iso8601, tenacity, funcsigs, json-merge-patch, zope.deprecation, gunicorn, apache-airflow
Attempting uninstall: attrs
Found existing installation: attrs 19.2.0
Uninstalling attrs-19.2.0:
Successfully uninstalled attrs-19.2.0
Running setup.py install for setproctitle ... error
ERROR: Command errored out with exit status 1:
command: /Users/gofrogs/Downloads/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/7s/9jm62xrs77x3mvsjfkd_7fq80000gn/T/pip-install-hnedol5a/setproctitle/setup.py'"'"'; __file__='"'"'/private/var/folders/7s/9jm62xrs77x3mvsjfkd_7fq80000gn/T/pip-install-hnedol5a/setproctitle/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/7s/9jm62xrs77x3mvsjfkd_7fq80000gn/T/pip-record-cl1apnxt/install-record.txt --single-version-externally-managed --compile --install-headers /Users/gofrogs/Downloads/anaconda3/include/python3.7m/setproctitle
cwd: /private/var/folders/7s/9jm62xrs77x3mvsjfkd_7fq80000gn/T/pip-install-hnedol5a/setproctitle/
Complete output (10 lines):
running install
running build
running build_ext
building 'setproctitle' extension
creating build
creating build/temp.macosx-10.9-x86_64-3.7
creating build/temp.macosx-10.9-x86_64-3.7/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/gofrogs/Downloads/anaconda3/include -arch x86_64 -I/Users/gofrogs/Downloads/anaconda3/include -arch x86_64 -DSPT_VERSION=1.1.10 -D__darwin__=1 -I/Users/gofrogs/Downloads/anaconda3/include/python3.7m -c src/setproctitle.c -o build/temp.macosx-10.9-x86_64-3.7/src/setproctitle.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: /Users/gofrogs/Downloads/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/7s/9jm62xrs77x3mvsjfkd_7fq80000gn/T/pip-install-hnedol5a/setproctitle/setup.py'"'"'; __file__='"'"'/private/var/folders/7s/9jm62xrs77x3mvsjfkd_7fq80000gn/T/pip-install-hnedol5a/setproctitle/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/7s/9jm62xrs77x3mvsjfkd_7fq80000gn/T/pip-record-cl1apnxt/install-record.txt --single-version-externally-managed --compile --install-headers /Users/gofrogs/Downloads/anaconda3/include/python3.7m/setproctitle Check the logs for full command output.
Could you please suggest me what needs to be fixed? Also, if possible please share link(s) to detailed explanation/tutorials about airflow so I/future readers can follow the best resources?
Your issue is typically related to Xcode toolkit.
Type this command in your terminal
xcode-select --install
If that doesn't work, you can always try to update the toolkit first.

Installation Error for python-crfsuite on MacOS

I want to install crfsuite for python3 using
pip3 install python-crfsuite
but it throws an error.
Building wheel for python-crfsuite (setup.py) ... error
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.7/bin
/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] =
'"'"'/private/var/folders/v7/q8v7r4xs6bzc7fpl1xlb3zgh0000gn/T/pip-
install-jcwoi004/python-crfsuite/setup.py'"'"';
__file__='"'"'/private/var/folders
/v7/q8v7r4xs6bzc7fpl1xlb3zgh0000gn/T/pip-install-jcwoi004/python-
crfsuite/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
/v7/q8v7r4xs6bzc7fpl1xlb3zgh0000gn/T/pip-wheel-evw_5zco --python-
tag cp37
cwd: /private/var/folders/v7/q8v7r4xs6bzc7fpl1xlb3zgh0000gn
/T/pip-install-jcwoi004/python-crfsuite/
Complete output (25 lines):
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.7
creating build/lib.macosx-10.9-x86_64-3.7/pycrfsuite
copying pycrfsuite/__init__.py -> build/lib.macosx-10.9-
x86_64-3.7/pycrfsuite
copying pycrfsuite/_dumpparser.py -> build/lib.macosx-10.9-
x86_64-3.7/pycrfsuite
copying pycrfsuite/_logparser.py -> build/lib.macosx-10.9-
x86_64-3.7/pycrfsuite
running build_ext
building 'pycrfsuite._pycrfsuite' extension
creating build/temp.macosx-10.9-x86_64-3.7
creating build/temp.macosx-10.9-x86_64-3.7/pycrfsuite
creating build/temp.macosx-10.9-x86_64-3.7/crfsuite
creating build/temp.macosx-10.9-x86_64-3.7/crfsuite/lib
creating build/temp.macosx-10.9-x86_64-3.7/crfsuite/lib/crf
creating build/temp.macosx-10.9-x86_64-3.7/crfsuite
/lib/crf/src
creating build/temp.macosx-10.9-x86_64-3.7/crfsuite/swig
creating build/temp.macosx-10.9-x86_64-3.7/crfsuite/lib/cqdb
creating build/temp.macosx-10.9-x86_64-3.7/crfsuite/lib/cqdb/src
creating build/temp.macosx-10.9-x86_64-3.7/liblbfgs
creating build/temp.macosx-10.9-x86_64-3.7/liblbfgs/lib
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-
common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g
-Icrfsuite/include/ -Icrfsuite/lib/cqdb/include -Iliblbfgs/include
-Ipycrfsuite -I/Library/Frameworks/Python.framework/Versions
/3.7/include/python3.7m -c pycrfsuite/_pycrfsuite.cpp -o
build/temp.macosx-10.9-x86_64-3.7/pycrfsuite/_pycrfsuite.o -std=c99
error: invalid argument '-std=c99' not allowed with 'C++/ObjC++'
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for python-crfsuite
Running setup.py clean for python-crfsuite
Failed to build python-crfsuite
Installing collected packages: python-crfsuite
Running setup.py install for python-crfsuite ... error
ERROR: Command errored out with exit status 1:
command: /Library/Frameworks/Python.framework/Versions/3.7/bin
/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] =
'"'"'/private/var/folders/v7/q8v7r4xs6bzc7fpl1xlb3zgh0000gn/T/pip-
install-jcwoi004/python-crfsuite/setup.py'"'"';
__file__='"'"'/private/var/folders
/v7/q8v7r4xs6bzc7fpl1xlb3zgh0000gn/T/pip-install-jcwoi004/python-
crfsuite/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
/v7/q8v7r4xs6bzc7fpl1xlb3zgh0000gn/T/pip-record-xhn2aymp/install-
record.txt --single-version-externally-managed --compile
cwd: /private/var/folders
/v7/q8v7r4xs6bzc7fpl1xlb3zgh0000gn/T/pip-install-jcwoi004/python-
crfsuite/
Complete output (25 lines):
running install
running build
running build_py
creating build
creating build/lib.macosx-10.9-x86_64-3.7
creating build/lib.macosx-10.9-x86_64-3.7/pycrfsuite
copying pycrfsuite/__init__.py -> build/lib.macosx-10.9-
x86_64-3.7/pycrfsuite
copying pycrfsuite/_dumpparser.py -> build/lib.macosx-10.9-
x86_64-3.7/pycrfsuite
copying pycrfsuite/_logparser.py -> build/lib.macosx-10.9-
x86_64-3.7/pycrfsuite
running build_ext
building 'pycrfsuite._pycrfsuite' extension
creating build/temp.macosx-10.9-x86_64-3.7
creating build/temp.macosx-10.9-x86_64-3.7/pycrfsuite
creating build/temp.macosx-10.9-x86_64-3.7/crfsuite
creating build/temp.macosx-10.9-x86_64-3.7/crfsuite/lib
creating build/temp.macosx-10.9-x86_64-3.7/crfsuite/lib/crf
creating build/temp.macosx-10.9-x86_64-3.7/crfsuite/lib/crf/src
creating build/temp.macosx-10.9-x86_64-3.7/crfsuite/swig
creating build/temp.macosx-10.9-x86_64-3.7/crfsuite/lib/cqdb
creating build/temp.macosx-10.9-x86_64-3.7/crfsuite
/lib/cqdb/src
creating build/temp.macosx-10.9-x86_64-3.7/liblbfgs
creating build/temp.macosx-10.9-x86_64-3.7/liblbfgs/lib
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-
common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch x86_64 -g
-Icrfsuite/include/ -Icrfsuite/lib/cqdb/include -Iliblbfgs/include
-Ipycrfsuite -I/Library/Frameworks/Python.framework/Versions
/3.7/include/python3.7m -c pycrfsuite/_pycrfsuite.cpp -o
build/temp.macosx-10.9-x86_64-3.7/pycrfsuite/_pycrfsuite.o -std=c99
error: invalid argument '-std=c99' not allowed with
'C++/ObjC++'
error: command 'gcc' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Library/Frameworks
/Python.framework/Versions/3.7/bin/python3 -u -c 'import sys,
setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders
/v7/q8v7r4xs6bzc7fpl1xlb3zgh0000gn/T/pip-install-jcwoi004/python-
crfsuite/setup.py'"'"'; __file__='"'"'/private/var/folders
/v7/q8v7r4xs6bzc7fpl1xlb3zgh0000gn/T/pip-install-jcwoi004/python-
crfsuite/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
/v7/q8v7r4xs6bzc7fpl1xlb3zgh0000gn/T/pip-record-xhn2aymp/install-
record.txt --single-version-externally-managed --compile Check the
logs for full command output.
I haven't seen anyone else with the same problem, perhaps it's something obvious that I just can't see. I'm also new to MacOS and this didn't happen to me on Windows.
the pip version is 19.2.3 .
If somebody could please help me with this.
There are a bunch of issues about this problem on the github repo, but are mostly closed with a reference to just use conda install, which is not really applicable in this case. One of them is mentioned in a pull request removing the flag causing the problem, so you might try installing from source, using the version from the pedning pull request like so:
pip install git+git://github.com/kvinwang/python-crfsuite.git#fix69

Resources