When I try to install new python packages with pip, I get the following error. Looks like gcc can't find the Availability.h header file. I've had this problem with multiple python packages so it's not just problem with the library. I'm running Anaconda 2.2.0 and I'm on Mac OS X Yosemite 10.10.2 64-bit .
I tried reinstalling Xcode and Xcode dev tools since it appears to be a problem with gcc, but that didn't work.
beavernet-163:desktop David$ pip install bllipparser
Collecting bllipparser
Using cached bllipparser-2015.01.11.tar.gz
Installing collected packages: bllipparser
Running setup.py install for bllipparser
Complete output from command /Users/David/anaconda/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/0d/n030c4312490_6px0bt47_wh0000gn/T/pip-build-X5SLrE/bllipparser/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/0d/n030c4312490_6px0bt47_wh0000gn/T/pip-FzytLX-record/install-record.txt --single-version-externally-managed --compile:
/Users/David/anaconda/lib/python2.7/site-packages/setuptools-14.3-py2.7.egg/setuptools/dist.py:282: UserWarning: Normalizing '2015.01.11' to '2015.1.11'
running install
running build
running build_py
creating build
creating build/lib.macosx-10.5-x86_64-2.7
creating build/lib.macosx-10.5-x86_64-2.7/bllipparser
copying python/bllipparser/__init__.py -> build/lib.macosx-10.5-x86_64-2.7/bllipparser
copying python/bllipparser/CharniakParser.py -> build/lib.macosx-10.5-x86_64-2.7/bllipparser
copying python/bllipparser/JohnsonReranker.py -> build/lib.macosx-10.5-x86_64-2.7/bllipparser
copying python/bllipparser/ModelFetcher.py -> build/lib.macosx-10.5-x86_64-2.7/bllipparser
copying python/bllipparser/ParsingShell.py -> build/lib.macosx-10.5-x86_64-2.7/bllipparser
copying python/bllipparser/RerankerFeatureCorpus.py -> build/lib.macosx-10.5-x86_64-2.7/bllipparser
copying python/bllipparser/RerankingParser.py -> build/lib.macosx-10.5-x86_64-2.7/bllipparser
running build_ext
building 'bllipparser._CharniakParser' extension
creating build/temp.macosx-10.5-x86_64-2.7
creating build/temp.macosx-10.5-x86_64-2.7/first-stage
creating build/temp.macosx-10.5-x86_64-2.7/first-stage/PARSE
gcc -fno-strict-aliasing -I/Users/David/anaconda/include -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -Ifirst-stage/PARSE/ -I/Users/David/anaconda/include/python2.7 -c first-stage/PARSE/parser_wrapper.C -o build/temp.macosx-10.5-x86_64-2.7/first-stage/PARSE/parser_wrapper.o
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++ [enabled by default]
In file included from /Users/David/anaconda/include/python2.7/pyport.h:325:0,
from /Users/David/anaconda/include/python2.7/Python.h:58,
from first-stage/PARSE/parser_wrapper.C:155:
/usr/local/lib/gcc/x86_64-apple-darwin12.5.0/4.8.1/include-fixed/math.h:54:26: fatal error: Availability.h: No such file or directory
#include <Availability.h>
^
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/Users/David/anaconda/bin/python -c "import setuptools, tokenize;__file__='/private/var/folders/0d/n030c4312490_6px0bt47_wh0000gn/T/pip-build-X5SLrE/bllipparser/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/0d/n030c4312490_6px0bt47_wh0000gn/T/pip-FzytLX-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/0d/n030c4312490_6px0bt47_wh0000gn/T/pip-build-X5SLrE/bllipparser
Here is the gcc version.
beavernet-163:desktop David$ gcc --version
gcc: warning: couldn’t understand kern.osversion ‘14.1.0
gcc (GCC) 4.8.1
And Xcode version is 6.2.
Related
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.
I am trying to install pyaudio on my system.
System Specification: macOS Mojava
Version: 10.14.2 (18C54)
Error that I am getting is this:
Collecting pyaudio
Using cached https://files.pythonhosted.org/packages/ab/42/b4f04721c5c5bfc196ce156b3c768998ef8c0ae3654ed29ea5020c749a6b/PyAudio-0.2.11.tar.gz
Building wheels for collected packages: pyaudio
Running setup.py bdist_wheel for pyaudio ... error
Complete output from command /Users/dsnanaware/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/r7/64j7w40s1fn8bmdkblq1pbym0000gn/T/pip-install-yro3wf2m/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 /private/var/folders/r7/64j7w40s1fn8bmdkblq1pbym0000gn/T/pip-wheel-3d4sruhv --python-tag cp36:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.7-x86_64-3.6
copying src/pyaudio.py -> build/lib.macosx-10.7-x86_64-3.6
running build_ext
building '_portaudio' extension
creating build/temp.macosx-10.7-x86_64-3.6
creating build/temp.macosx-10.7-x86_64-3.6/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/dsnanaware/anaconda3/include -arch x86_64 -I/Users/dsnanaware/anaconda3/include -arch x86_64 -DMACOSX=1 -I/Users/dsnanaware/anaconda3/include/python3.6m -c src/_portaudiomodule.c -o build/temp.macosx-10.7-x86_64-3.6/src/_portaudiomodule.o
src/_portaudiomodule.c:27:19: fatal error: stdio.h: No such file or directory
#include <stdio.h>
^
compilation terminated.
error: command '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 /Users/dsnanaware/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/r7/64j7w40s1fn8bmdkblq1pbym0000gn/T/pip-install-yro3wf2m/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/r7/64j7w40s1fn8bmdkblq1pbym0000gn/T/pip-record-4xqsbegf/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.macosx-10.7-x86_64-3.6
copying src/pyaudio.py -> build/lib.macosx-10.7-x86_64-3.6
running build_ext
building '_portaudio' extension
creating build/temp.macosx-10.7-x86_64-3.6
creating build/temp.macosx-10.7-x86_64-3.6/src
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/dsnanaware/anaconda3/include -arch x86_64 -I/Users/dsnanaware/anaconda3/include -arch x86_64 -DMACOSX=1 -I/Users/dsnanaware/anaconda3/include/python3.6m -c src/_portaudiomodule.c -o build/temp.macosx-10.7-x86_64-3.6/src/_portaudiomodule.o
src/_portaudiomodule.c:27:19: fatal error: stdio.h: No such file or directory
#include <stdio.h>
^
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/Users/dsnanaware/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/private/var/folders/r7/64j7w40s1fn8bmdkblq1pbym0000gn/T/pip-install-yro3wf2m/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/r7/64j7w40s1fn8bmdkblq1pbym0000gn/T/pip-record-4xqsbegf/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/r7/64j7w40s1fn8bmdkblq1pbym0000gn/T/pip-install-yro3wf2m/pyaudio/
Method that I have tried to fix this:
brew install portaudio
pip install pyaudio
But even after trying this I am getting the same error.
Can anyone help me with this error??
Thank You !!
Solution:
brew update
brew install portaudio
brew link --overwrite portaudio
pip install pyaudio
https://medium.com/#moon_is_beautiful/when-cant-install-pyaudio-with-pip-190973840dbf
For me, it worked following this Gist
https://gist.github.com/jiaaro/9767512210a1d80a8a0d
Install portaudio using homebrew (or method of your choice)
brew install portaudio
create $HOME/.pydistutils.cfg using the include and lib directories of your portaudio install:
[build_ext]
include_dirs=/Users/jrobert1271/homebrew/Cellar/portaudio/19.20140130/include/
library_dirs=/Users/jrobert1271/homebrew/Cellar/portaudio/19.20140130/lib/
Then in your virtualenv:
pip install --global-option='build_ext' --global-option='-I/usr/local/include' --global-option='-L/usr/local/lib' pyaudio
i want install sndfile to successfully install another package (musdb), but when I tried following instructions on https://cloud.google.com/datalab/docs/how-to/adding-libraries
!pip install sndfile
It gives me the following error:
{Collecting sndfile
Using cached https://files.pythonhosted.org/packages/db/ce/797cacd78490aa9de2e0e119491079d380e2fbbd7a1c5057c9fb2120a643/sndfile-0.2.0.tar.gz
Requirement already satisfied: cffi>=1.0.0 in /usr/local/envs/py2env/lib/python2.7/site-packages (from sndfile) (1.11.5)
Requirement already satisfied: pycparser in /usr/local/envs/py2env/lib/python2.7/site-packages (from cffi>=1.0.0->sndfile) (2.18)
Building wheels for collected packages: sndfile
Running setup.py bdist_wheel for sndfile ... error
Complete output from command /usr/local/envs/py2env/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-NZx2D1/sndfile/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-YWj7At --python-tag cp27:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/sndfile
copying sndfile/__init__.py -> build/lib.linux-x86_64-2.7/sndfile
copying sndfile/build.py -> build/lib.linux-x86_64-2.7/sndfile
copying sndfile/io.py -> build/lib.linux-x86_64-2.7/sndfile
copying sndfile/vio.py -> build/lib.linux-x86_64-2.7/sndfile
copying sndfile/formats.py -> build/lib.linux-x86_64-2.7/sndfile
running build_ext
generating cffi module 'build/temp.linux-x86_64-2.7/sndfile._sndfile.c'
creating build/temp.linux-x86_64-2.7
building 'sndfile._sndfile' extension
creating build/temp.linux-x86_64-2.7/build
creating build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7
gcc -pthread -B /usr/local/envs/py2env/compiler_compat -Wl,--sysroot=/ -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/envs/py2env/include/python2.7 -c
build/temp.linux-x86_64-2.7/sndfile._sndfile.c -o build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7/sndfile._sndfile.o
build/temp.linux-x86_64-2.7/sndfile._sndfile.c:494:21: fatal error: sndfile.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
Failed building wheel for sndfile
Running setup.py clean for sndfile
Failed to build sndfile
Installing collected packages: sndfile
Running setup.py install for sndfile ... error
Complete output from command /usr/local/envs/py2env/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-NZx2D1/sndfile/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-FMQzpS/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/sndfile
copying sndfile/__init__.py -> build/lib.linux-x86_64-2.7/sndfile
copying sndfile/build.py -> build/lib.linux-x86_64-2.7/sndfile
copying sndfile/io.py -> build/lib.linux-x86_64-2.7/sndfile
copying sndfile/vio.py -> build/lib.linux-x86_64-2.7/sndfile
copying sndfile/formats.py -> build/lib.linux-x86_64-2.7/sndfile
running build_ext
generating cffi module 'build/temp.linux-x86_64-2.7/sndfile._sndfile.c'
creating build/temp.linux-x86_64-2.7
building 'sndfile._sndfile' extension
creating build/temp.linux-x86_64-2.7/build
creating build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7
gcc -pthread -B /usr/local/envs/py2env/compiler_compat -Wl,--sysroot=/ -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/local/envs/py2env/include/python2.7 -c build/temp.linux-x86_64-2.7/sndfile._sndfile.c -o build/temp.linux-x86_64-2.7/build/temp.linux-x86_64-2.7/sndfile._sndfile.o
build/temp.linux-x86_64-2.7/sndfile._sndfile.c:494:21: fatal error: sndfile.h: No such file or directory
compilation terminated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/usr/local/envs/py2env/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-NZx2D1/sndfile/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-FMQzpS/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-NZx2D1/sndfile/}
I tried to google around, it either suggested to download via conda, which seems difficult with datalab, or with the following command
sudo apt-get install libsndfile1
which gives me a syntax error in datalab.
I need this library since I am trying to import musdb and after installing, when I try to import, it gives me the following error:
import musdb
OSErrorTraceback (most recent call last)
in <module> . ()
----> 1 import musdb
/usr/local/envs/py2env/lib/python2.7/site-packages/musdb/__init__.py in <module>()
1 from __future__ import print_function
----> 2 from .audio_classes import Track, Source, Target
3 from os import path as op
4 from six.moves import map
5 import multiprocessing
/usr/local/envs/py2env/lib/python2.7/site-packages/musdb/audio_classes.py in <module>()
2 from __future__ import division
3 import os
----> 4 import soundfile as sf
5 import numpy as np
6 import stempeg
/usr/local/envs/py2env/lib/python2.7/site-packages/soundfile.py in <module>()
140 _libname = _find_library('sndfile')
141 if _libname is None:
--> 142 raise OSError('sndfile library not found')
143 _snd = _ffi.dlopen(_libname)
144 except OSError:
OSError: sndfile library not found
any insights are greatly appreciated!
Datalab comes with conda ready to use in Python 2 and 3 environments. This means you should be able to get what you need with the following:
%%bash
conda install -y libsndfile ffmpeg
pip install musdb
I ran the following command (because I have both python2 and python3 on my mac):
$ CFLAGS=-I/usr/local/opt/icu4c/include LDFLAGS=-L/usr/local/opt/icu4c/lib sudo python3 -m pip install pyicu
The error information is as below:
Installing collected packages: pyicu
Running setup.py install for pyicu ... error
Complete output from command /anaconda3/bin/python3 -u -c "import setuptools, tokenize;file='/private/tmp/pip-build-l71tm0m4/pyicu/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-7298jccr-record/install-record.txt --single-version-externally-managed --compile:
Building PyICU 2.0.3 for ICU 58.2
Adding CXXFLAGS="-I/anaconda3/include" from /anaconda3/bin/icu-config
Adding LDFLAGS="-Wl,-rpath,/anaconda3/lib -L/anaconda3/lib -licui18n -licuuc -licudata" from /anaconda3/bin/icu-config
running install
running build
running build_py
creating build
creating build/lib.macosx-10.7-x86_64-3.6
copying PyICU.py -> build/lib.macosx-10.7-x86_64-3.6
creating build/lib.macosx-10.7-x86_64-3.6/icu
copying icu/__init__.py -> build/lib.macosx-10.7-x86_64-3.6/icu
running build_ext
building '_icu' extension
creating build/temp.macosx-10.7-x86_64-3.6
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/anaconda3/include -arch x86_64 -I/anaconda3/include -arch x86_64 -I/anaconda3/include/python3.6m -c _icu.cpp -o build/temp.macosx-10.7-x86_64-3.6/_icu.o -DPYICU_VER="2.0.3" -I/anaconda3/include
In file included from _icu.cpp:27:
./common.h:38:13: error: unknown type name 'decltype'
typedef decltype(nullptr) nullptr_t;
^
./common.h:38:30: error: expected ';' after top level declarator
typedef decltype(nullptr) nullptr_t;
^
;
2 errors generated.
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/anaconda3/bin/python3 -u -c "import setuptools, tokenize;file='/private/tmp/pip-build-l71tm0m4/pyicu/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-7298jccr-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-l71tm0m4/pyicu/
According to #n.m., -std=c++11 needs to be added to CFLAGS.
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