alexylem / jarvis

Jarvis.sh is a simple configurable multi-lang assistant.
http://openjarvis.com
MIT License
810 stars 197 forks source link

src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found #551

Closed NikoS34 closed 7 years ago

NikoS34 commented 7 years ago

Bonjour,

j'utilise déjà Jarvis depuis pas mal de temps sur un PI3 et je souhaite le tester sur MacOS. Dans l'ordre, sur un macmini (Mid2011):

le début de l'install se passe bien (test speaker et micro compris) puis çà se gâte :

------------------------------------------------------------------------------------------------
1/2 Preparation of dependencies
--2017-04-18 18:06:13--  https://bootstrap.pypa.io/get-pip.py
Resolving bootstrap.pypa.io... 151.101.120.175
Connecting to bootstrap.pypa.io|151.101.120.175|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1595408 (1.5M) [text/x-python]
Saving to: ‘get-pip.py’

get-pip.py          100%[===================>]   1.52M  1.37MB/s    in 1.1s

2017-04-18 18:06:14 (1.37 MB/s) - ‘get-pip.py’ saved [1595408/1595408]

Password:
The directory '/Users/admin/Library/Caches/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 '/Users/admin/Library/Caches/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.
Requirement already up-to-date: pip in /Library/Python/2.7/site-packages
The directory '/Users/admin/Library/Caches/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 '/Users/admin/Library/Caches/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.11.tar.gz
Installing collected packages: pyaudio
  Running setup.py install for pyaudio ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-6RvfYE/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-BSdL48-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.12-intel-2.7
    copying src/pyaudio.py -> build/lib.macosx-10.12-intel-2.7
    running build_ext
    building '_portaudio' extension
    creating build/temp.macosx-10.12-intel-2.7
    creating build/temp.macosx-10.12-intel-2.7/src
    cc -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -DMACOSX=1 -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/_portaudiomodule.c -o build/temp.macosx-10.12-intel-2.7/src/_portaudiomodule.o
    src/_portaudiomodule.c:29:10: fatal error: 'portaudio.h' file not found
    #include "portaudio.h"
             ^
    1 error generated.
    error: command 'cc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/private/tmp/pip-build-6RvfYE/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-BSdL48-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/tmp/pip-build-6RvfYE/pyaudio/
admins-Mac-mini:jarvis admin$
------------------------------------------------------------------------------------------------

Une idée ?

- NikoS

alexylem commented 7 years ago

C'est au moment d'installer snowboy? Essaye manuellement cette étape pour reproduire:

sudo pip install pyaudio

D'après ma recherche google, tente:

pip install --global-option='build_ext' --global-option='-I/usr/local/include' --global-option='-L/usr/local/lib' pyaudio
NikoS34 commented 7 years ago

En effet sudo pip install pyaudio reproduit bien le pb.

Pb aussi pour: pip install --global-option='build_ext' --global-option='-I/usr/local/include' --global-option='-L/usr/local/lib' pyaudio

admins-Mac-mini:jarvis admin$ pip install --global-option='build_ext' --global-option='-I/usr/local/include' --global-option='-L/usr/local/lib' pyaudio /Library/Python/2.7/site-packages/pip/commands/install.py:194: UserWarning: Disabling all use of wheels due to the use of --build-options / --global-options / --install-options. cmdoptions.check_install_build_global(options) Collecting pyaudio Using cached PyAudio-0.2.11.tar.gz Skipping bdist_wheel for pyaudio, due to binaries being disabled for it. Installing collected packages: pyaudio Running setup.py install for pyaudio ... error Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/60/zt8wn1jj5x52m0tp5mng6vbc0000gn/T/pip-build-ZFv6q8/pyaudio/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" build_ext -I/usr/local/include -L/usr/local/lib install --record /var/folders/60/zt8wn1jj5x52m0tp5mng6vbc0000gn/T/pip-Ey_xzq-record/install-record.txt --single-version-externally-managed --compile: running build_ext building '_portaudio' extension creating build creating build/temp.macosx-10.12-intel-2.7 creating build/temp.macosx-10.12-intel-2.7/src cc -fno-strict-aliasing -fno-common -dynamic -arch i386 -arch x86_64 -g -Os -pipe -fno-common -fno-strict-aliasing -fwrapv -DENABLE_DTRACE -DMACOSX -DNDEBUG -Wall -Wstrict-prototypes -Wshorten-64-to-32 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch x86_64 -pipe -DMACOSX=1 -I/usr/local/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c src/_portaudiomodule.c -o build/temp.macosx-10.12-intel-2.7/src/_portaudiomodule.o creating build/lib.macosx-10.12-intel-2.7 cc -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -Wl,-F. build/temp.macosx-10.12-intel-2.7/src/_portaudiomodule.o -L/usr/local/lib -lportaudio -o build/lib.macosx-10.12-intel-2.7/_portaudio.so ld: warning: ignoring file /usr/local/lib/libportaudio.dylib, file was built for x86_64 which is not the architecture being linked (i386): /usr/local/lib/libportaudio.dylib running install running build running build_py copying src/pyaudio.py -> build/lib.macosx-10.12-intel-2.7 running install_lib copying build/lib.macosx-10.12-intel-2.7/_portaudio.so -> /Library/Python/2.7/site-packages error: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/_portaudio.so'

----------------------------------------

Command "/usr/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/60/zt8wn1jj5x52m0tp5mng6vbc0000gn/T/pip-build-ZFv6q8/pyaudio/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" build_ext -I/usr/local/include -L/usr/local/lib install --record /var/folders/60/zt8wn1jj5x52m0tp5mng6vbc0000gn/T/pip-Ey_xzq-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/60/zt8wn1jj5x52m0tp5mng6vbc0000gn/T/pip-build-ZFv6q8/pyaudio/

Sur quelle version d'OSX valides-tu Jarvis, stp ?

- NikoS

alexylem commented 7 years ago

Je suis sur Sierra 10.12.4

jv_arch              x86_64 
jv_os_name           Mac OS X 
jv_os_version        10.12.4 

Je vois un Permission denied Essayes avec sudo:

sudo pip install --global-option='build_ext' --global-option='-I/usr/local/include' --global-option='-L/usr/local/lib' pyaudio
NikoS34 commented 7 years ago

On a donc bien la même archi.

Et ça passe avec le sudo:

admins-Mac-mini:jarvis admin$ sudo pip install --global-option='build_ext' --global-option='-I/usr/local/include' --global-option='-L/usr/local/lib' pyaudio Password: Sorry, try again. Password: /Library/Python/2.7/site-packages/pip/commands/install.py:194: UserWarning: Disabling all use of wheels due to the use of --build-options / --global-options / --install-options. cmdoptions.check_install_build_global(options) The directory '/Users/admin/Library/Caches/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 '/Users/admin/Library/Caches/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.11.tar.gz Installing collected packages: pyaudio Running setup.py install for pyaudio ... done Successfully installed pyaudio-0.2.11

J'ai ensuite relancé l'install et ce coup-ci c'est bien allé jusqu'au bout, me reste plus donc qu'à tester Jarvis sur OSX !

Pour le Permission denied j'avais bien tenté de relancer l'install avec un sudo ./jarvis.sh mais c'est pas possible :

ERROR: Jarvis must not be used as root

L'essentiel est d'être allé au bout, mais je ne comprends pas pourquoi l'install standard ne passe pas sur cette machine...

Merci,

NikoS

alexylem commented 7 years ago

Je modifie l'install standard pour ajouter ces paramètres. Le script contient déjà sudo pour pip install pyaudio donc pas la peine de lancer Jarvis avec sudo (il va juste demander le mot de passe à ce moment la).

alexylem commented 7 years ago

@NikoS34 avant que je mette à jour le script pour tout le monde, tu peux faire un:

sudo find / -name "portaudio.h"

chez moi:

/usr/local/Cellar/portaudio/19.20140130/include/portaudio.h
/usr/local/include/portaudio.h
NikoS34 commented 7 years ago

admins-Mac-mini:~ admin$ sudo find / -name "portaudio.h" chez moi: /usr/local/Cellar/portaudio/19.6.0/include/portaudio.h /usr/local/include/portaudio.h

tigerneil commented 7 years ago

brew install portaudio solved this problem for me.

wikijm commented 7 years ago

@NikoS34 Could you please try @tigerneil's solution and make a feedback? Peux-tu tester la solution proposée par @tigerneil et nous faire un retour ?

wikijm commented 7 years ago

Clôture du ticket jusqu'à obtention d'une réponse de la part de l'auteur de l'issue. Closing of the ticket until a valid answer from the applicant is obtained.