2016-03-27 18 views
1

Python'u python'da kullanmaya çalışırken aşağıdaki hatayı alıyorum.jack sunucusu çalışmıyor veya başlatılamıyor

Python 2.7.10 (default, Oct 14 2015, 16:09:02) 
[GCC 5.2.1 20151010] on linux2 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import pyaudio 
>>> p = pyaudio.PyAudio() 
ALSA lib pcm.c:2267:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear 
ALSA lib pcm.c:2267:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe 
ALSA lib pcm.c:2267:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side 
ALSA lib pcm_route.c:867:(find_matching_chmap) Found no matching channel map 
ALSA lib pcm_route.c:867:(find_matching_chmap) Found no matching channel map 
Cannot connect to server socket err = No such file or directory 
Cannot connect to server request channel 
jack server is not running or cannot be started 

Sorun, pyaudio'nun bir sürümüne özgü gibi görünüyor, bu nedenle güncelleştirmeye çalışıyorum. Ben pyaudio güncelleştirmeye çalıştığınızda : Bu mesajlardan

[email protected]:/etc/apt/sources.list.d$ sudo pip install pyaudio --upgrade 
The directory '/home/abhishek/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.        
The directory '/home/abhishek/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.          
Collecting pyaudio 
    Downloading PyAudio-0.2.9.tar.gz (289kB) 
    100% |████████████████████████████████| 296kB 539kB/s 
Installing collected packages: pyaudio 
    Found existing installation: PyAudio 0.2.8 
    DEPRECATION: Uninstalling a distutils installed project (pyaudio) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.            
    Uninstalling PyAudio-0.2.8: 
     Successfully uninstalled PyAudio-0.2.8 
    Running setup.py install for pyaudio ... error 
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-15VuRi/pyaudio/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-QGLaRp-record/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 
    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 -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c src/_portaudiomodule.c -o build/temp.linux-x86_64-2.7/src/_portaudiomodule.o 
    src/_portaudiomodule.c:28:20: fatal error: Python.h: No such file or directory 
    compilation terminated. 
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 

    ---------------------------------------- 
    Rolling back uninstall of PyAudio 
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-15VuRi/pyaudio/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-QGLaRp-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-15VuRi/pyaudio/                      

cevap

1

Yok fiili hatalardır. PortAudio, olası tüm ana makine API'lerini ve cihazlarını "ping" eder ve kullanılabilir olup olmadıklarına bakar. Bu genellikle terminalde, çoğu durumda göz ardı edilebilecek birkaç mesaja yol açar.

Bu iletileri basmayan bir Python PortAudio sarıcısı istiyorsanız (bunları sizin için bastırdığı için), sounddevice modülünü gözden geçirin.

+0

@Matthai thx. Güncelleme hatasıyla ilgili herhangi bir fikir. –

+0

'Python.h' dosyası bulunamadı. 'Python-dev' paketini kurarak alabilirsiniz. Ama buna ihtiyacınız yok, çünkü PyAudio önceden derlenmiş bir paket olarak zaten mevcut: 'python-pyaudio'. BTW, Python 3'ü kullanmayı düşünmelisiniz, o zaman python3-pyaudio'ya ihtiyacınız olacak. – Matthias