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
Related
I'm trying to get install TA-lib, but running into errors I don't understand.
I installed brew, and ran the following:
brew install ta-lib
That seemed to work because if I re-run that, I get a note that
ta-lib 0.4.0 is already installed and up-to-date
However, running pip3 install ta-lib results in the following errors. From googling around, this seems to happen when ta-lib wasn't installed first, but not sure how to address when the initial install seems to go fine.
pip3 install TA-lib
Collecting TA-lib
Using cached TA-Lib-0.4.19.tar.gz (267 kB)
Requirement already satisfied: numpy in /Users/mf/venv/lib/python3.8/site-packages (from TA-lib) (1.19.5)
Using legacy 'setup.py install' for TA-lib, since package 'wheel' is not installed.
Installing collected packages: TA-lib
Running setup.py install for TA-lib ... error
ERROR: Command errored out with exit status 1:
command: /Users/mf/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/p3/nd5fr9yd2xb7qnjnln6vk2cw0000gn/T/pip-install-armqiybl/ta-lib_03c018e0f8f24266a3c6fc47436cf143/setup.py'"'"'; __file__='"'"'/private/var/folders/p3/nd5fr9yd2xb7qnjnln6vk2cw0000gn/T/pip-install-armqiybl/ta-lib_03c018e0f8f24266a3c6fc47436cf143/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/p3/nd5fr9yd2xb7qnjnln6vk2cw0000gn/T/pip-record-q2zdmts7/install-record.txt --single-version-externally-managed --compile --install-headers /Users/mf/venv/include/site/python3.8/TA-lib
cwd: /private/var/folders/p3/nd5fr9yd2xb7qnjnln6vk2cw0000gn/T/pip-install-armqiybl/ta-lib_03c018e0f8f24266a3c6fc47436cf143/
Complete output (27 lines):
/private/var/folders/p3/nd5fr9yd2xb7qnjnln6vk2cw0000gn/T/pip-install-armqiybl/ta-lib_03c018e0f8f24266a3c6fc47436cf143/setup.py:71: UserWarning: Cannot find ta-lib library, installation may fail.
warnings.warn('Cannot find ta-lib library, installation may fail.')
running install
running build
running build_py
creating build
creating build/lib.macosx-10.14.6-x86_64-3.8
creating build/lib.macosx-10.14.6-x86_64-3.8/talib
copying talib/abstract.py -> build/lib.macosx-10.14.6-x86_64-3.8/talib
copying talib/test_abstract.py -> build/lib.macosx-10.14.6-x86_64-3.8/talib
copying talib/deprecated.py -> build/lib.macosx-10.14.6-x86_64-3.8/talib
copying talib/__init__.py -> build/lib.macosx-10.14.6-x86_64-3.8/talib
copying talib/stream.py -> build/lib.macosx-10.14.6-x86_64-3.8/talib
copying talib/test_pandas.py -> build/lib.macosx-10.14.6-x86_64-3.8/talib
copying talib/test_data.py -> build/lib.macosx-10.14.6-x86_64-3.8/talib
copying talib/test_func.py -> build/lib.macosx-10.14.6-x86_64-3.8/talib
copying talib/test_stream.py -> build/lib.macosx-10.14.6-x86_64-3.8/talib
running build_ext
building 'talib._ta_lib' extension
creating build/temp.macosx-10.14.6-x86_64-3.8
creating build/temp.macosx-10.14.6-x86_64-3.8/talib
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/Headers -arch arm64 -arch x86_64 -I/usr/include -I/usr/local/include -I/opt/include -I/opt/local/include -I/Users/mf/venv/lib/python3.8/site-packages/numpy/core/include -I/Users/mf/venv/include -I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/include/python3.8 -c talib/_ta_lib.c -o build/temp.macosx-10.14.6-x86_64-3.8/talib/_ta_lib.o
talib/_ta_lib.c:611:10: fatal error: 'ta-lib/ta_defs.h' file not found
#include "ta-lib/ta_defs.h"
^~~~~~~~~~~~~~~~~~
1 error generated.
error: command 'clang' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: /Users/mf/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/p3/nd5fr9yd2xb7qnjnln6vk2cw0000gn/T/pip-install-armqiybl/ta-lib_03c018e0f8f24266a3c6fc47436cf143/setup.py'"'"'; __file__='"'"'/private/var/folders/p3/nd5fr9yd2xb7qnjnln6vk2cw0000gn/T/pip-install-armqiybl/ta-lib_03c018e0f8f24266a3c6fc47436cf143/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/p3/nd5fr9yd2xb7qnjnln6vk2cw0000gn/T/pip-record-q2zdmts7/install-record.txt --single-version-externally-managed --compile --install-headers /Users/mf/venv/include/site/python3.8/TA-lib Check the logs for full command output.
I updated TA_LIBRARY_PATH & TA_INCLUDE_PATH after finding where brew was installing ta-lib, ran the following and pip3 install seemed to work properly, but I wasn't able to actually import it. After trying to re-install ta-lib, I get the same error as above.
export TA_LIBRARY_PATH=/opt/homebrew/opt/ta-lib/lib
export TA_INCLUDE_PATH=/opt/homebrew/opt/ta-lib/include
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
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?
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!
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.