cannot instal soundfile in datalab - python

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

Related

installing pyaudio on mac

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

Issue installing python-snappy

I'm trying to install python-snappy in Amazon Linux EC2 instance but I keep getting the below error, Any idea how to fix this issue:
sudo python3.6 -m pip install python-snappy
Collecting python-snappy
Using cached https://files.pythonhosted.org/packages/89/fe/a81a219c183c7e578b6f82d9c2425df045548877be6559358e8560c1e9fd/python-snappy-0.5.3.tar.gz
Installing collected packages: python-snappy
Running setup.py install for python-snappy ... error
Complete output from command /usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-e07ios_o/python-snappy/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-k7rd94ik/install-record.txt --single-version-externally-managed --compile:
/usr/lib64/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'cffi_modules'
warnings.warn(msg)
running install
running build
running build_py
creating build
creating build/lib.linux-x86_64-3.6
creating build/lib.linux-x86_64-3.6/snappy
copying snappy/snappy_cffi.py -> build/lib.linux-x86_64-3.6/snappy
copying snappy/snappy_formats.py -> build/lib.linux-x86_64-3.6/snappy
copying snappy/snappy.py -> build/lib.linux-x86_64-3.6/snappy
copying snappy/__init__.py -> build/lib.linux-x86_64-3.6/snappy
copying snappy/snappy_cffi_builder.py -> build/lib.linux-x86_64-3.6/snappy
copying snappy/__main__.py -> build/lib.linux-x86_64-3.6/snappy
copying snappy/hadoop_snappy.py -> build/lib.linux-x86_64-3.6/snappy
running build_ext
building 'snappy._snappy' extension
creating build/temp.linux-x86_64-3.6
creating build/temp.linux-x86_64-3.6/snappy
gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python3.6m -c snappy/snappymodule.cc -o build/temp.linux-x86_64-3.6/snappy/snappymodule.o
gcc: error trying to exec 'cc1plus': execvp: No such file or directory
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-e07ios_o/python-snappy/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-k7rd94ik/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-e07ios_o/python-snappy/

pip install FuzzySet failed on OSX - virtualenv with python3

I'm trying to install FuzzySet in my virtualenv:
(virtualenv) machine:user$ pip install FuzzySet
and I got this error:
(virtualenv) machine:user$ pip install FuzzySet
Collecting FuzzySet
Using cached fuzzyset-0.0.11.tar.gz
Requirement already satisfied: python-levenshtein in /Users/dedeco/Envs/Craw/lib/python3.6/site-packages (from FuzzySet)
Requirement already satisfied: texttable in /Users/dedeco/Envs/Craw/lib/python3.6/site-packages (from FuzzySet)
Requirement already satisfied: setuptools in /Users/dedeco/Envs/Craw/lib/python3.6/site-packages (from python-levenshtein->FuzzySet)
Building wheels for collected packages: FuzzySet
Running setup.py bdist_wheel for FuzzySet ... error
Complete output from command /Users/dedeco/Envs/Craw/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/y7/1vddc8q51zq_q_dc0gw581480000gn/T/pip-build-1e0boni3/FuzzySet/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 /var/folders/y7/1vddc8q51zq_q_dc0gw581480000gn/T/tmpbguw98h6pip-wheel- --python-tag cp36:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.12-x86_64-3.6
creating build/lib.macosx-10.12-x86_64-3.6/fuzzyset
copying fuzzyset/__init__.py -> build/lib.macosx-10.12-x86_64-3.6/fuzzyset
running build_ext
building 'cfuzzyset' extension
creating build/temp.macosx-10.12-x86_64-3.6
creating build/temp.macosx-10.12-x86_64-3.6/fuzzyset
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -I/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c fuzzyset/cfuzzyset.c -o build/temp.macosx-10.12-x86_64-3.6/fuzzyset/cfuzzyset.o
clang: error: no such file or directory: 'fuzzyset/cfuzzyset.c'
clang: error: no input files
error: command 'clang' failed with exit status 1
----------------------------------------
Failed building wheel for FuzzySet
Running setup.py clean for FuzzySet
Failed to build FuzzySet
Installing collected packages: FuzzySet
Running setup.py install for FuzzySet ... error
Complete output from command /Users/dedeco/Envs/Craw/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/y7/1vddc8q51zq_q_dc0gw581480000gn/T/pip-build-1e0boni3/FuzzySet/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/y7/1vddc8q51zq_q_dc0gw581480000gn/T/pip-ku90bpma-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/dedeco/Envs/Craw/bin/../include/site/python3.6/FuzzySet:
running install
running build
running build_py
creating build
creating build/lib.macosx-10.12-x86_64-3.6
creating build/lib.macosx-10.12-x86_64-3.6/fuzzyset
copying fuzzyset/__init__.py -> build/lib.macosx-10.12-x86_64-3.6/fuzzyset
running build_ext
building 'cfuzzyset' extension
creating build/temp.macosx-10.12-x86_64-3.6
creating build/temp.macosx-10.12-x86_64-3.6/fuzzyset
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch x86_64 -I/usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c fuzzyset/cfuzzyset.c -o build/temp.macosx-10.12-x86_64-3.6/fuzzyset/cfuzzyset.o
clang: error: no such file or directory: 'fuzzyset/cfuzzyset.c'
clang: error: no input files
error: command 'clang' failed with exit status 1
----------------------------------------
Command "/Users/dedeco/Envs/Craw/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/y7/1vddc8q51zq_q_dc0gw581480000gn/T/pip-build-1e0boni3/FuzzySet/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/y7/1vddc8q51zq_q_dc0gw581480000gn/T/pip-ku90bpma-record/install-record.txt --single-version-externally-managed --compile --install-headers /Users/dedeco/Envs/Craw/bin/../include/site/python3.6/FuzzySet" failed with error code 1 in /private/var/folders/y7/1vddc8q51zq_q_dc0gw581480000gn/T/pip-build-1e0boni3/FuzzySet/
Can someone help me? I think that is related a compiler c in my machine, and is not able to compile, but I had installed a lot of things in past without problem.
phd's answer didn't fix it for me. Installing cython manually did the trick:
pip install cython
The fuzzyset package at PyPI lacks the file fuzzyset/cfuzzyset.c. It's a bug in the package, already reported.
Your only chance for now is to install from github:
pip install git+https://github.com/axiak/fuzzyset.git#egg=fuzzyset
Installing fuzzyset after installing cython fixed the problem for me
python -m pip install cython
python -m pip install fuzzyset
I couldn't get !pip install fuzzyset to work either on OS X, python 3.7. But !easy_install fuzzyset worked fine

Installing pyaudio with pip in a virtualenv

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

Can't find Availability.h header file with gcc

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.

Categories

Resources