mopidy / homebrew-mopidy

Homebrew formulas for Mopidy and Mopidy extensions
https://mopidy.com
Other
22 stars 15 forks source link

c/_cffi_backend.c:2:10: fatal error: 'Python.h' file not found #17

Closed tim-jones-001 closed 4 years ago

tim-jones-001 commented 6 years ago

Have been unable to install monpidy/spotify extension via homebrew as cffi seems not to be able to find the headers.

Have tried various things, suggested (e.g. updating xcode cmdline tools, setting environment variables), but none seem to have made any impact.

$ brew install mopidy-spotify
==> Installing mopidy-spotify from mopidy/mopidy
==> Installing dependencies for mopidy/mopidy/mopidy-spotify: mopidy/mopidy/python-cffi, mopidy/mopidy/python-spotify
==> Installing mopidy/mopidy/mopidy-spotify dependency: mopidy/mopidy/python-cffi
==> Downloading https://pypi.python.org/packages/83/3c/00b553fd05ae32f27b3637f705c413c4ce71290aa9b4c4764df694e906d9/cffi-1.7.0.tar.gz
Already downloaded: /Users/tim/Library/Caches/Homebrew/python-cffi-1.7.0.tar.gz
==> python -c import setuptools... --no-user-cfg install --prefix=/usr/local/Cellar/python-cffi/1.7.0 --single-version-externally-manag
Last 15 lines from /Users/tim/Library/Logs/Homebrew/python-cffi/01.python:
copying cffi/cparser.py -> build/lib.macosx-10.12-x86_64-2.7/cffi
copying cffi/verifier.py -> build/lib.macosx-10.12-x86_64-2.7/cffi
copying cffi/_cffi_include.h -> build/lib.macosx-10.12-x86_64-2.7/cffi
copying cffi/parse_c_type.h -> build/lib.macosx-10.12-x86_64-2.7/cffi
copying cffi/_embedding.h -> build/lib.macosx-10.12-x86_64-2.7/cffi
running build_ext
building '_cffi_backend' extension
creating build/temp.macosx-10.12-x86_64-2.7
creating build/temp.macosx-10.12-x86_64-2.7/c
clang -fno-strict-aliasing -fno-common -dynamic -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DUSE__THREAD -I/usr/include/ffi -I/usr/include/libffi -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c c/_cffi_backend.c -o build/temp.macosx-10.12-x86_64-2.7/c/_cffi_backend.o
c/_cffi_backend.c:2:10: fatal error: 'Python.h' file not found
#include <Python.h>
         ^~~~~~~~~~
1 error generated.
error: command 'clang' failed with exit status 1

If reporting this issue please do so at (not Homebrew/brew or Homebrew/core):
https://github.com/mopidy/homebrew-mopidy/issues
troyxmccall commented 6 years ago

hey @tim-jones-001 , try running xcode-select --install again (especially if you recently updated OSX), and then brew reinstall mopidy-spotify

PabloReszczynski commented 6 years ago

@troyxmccall I'm having the same problem, but your idea did't help. It seems the formula is not searching for the correct Python.h path. I tried running export C_INCLUDE_PATH=/System/Library/Frameworks/Python.framework/Headers before doing the installation but is not helping either.

tim-jones-001 commented 6 years ago

@troyxmccall Thanks for your reply

I had already tried to re-update xcode before, but, as it is already installed, it just gives:

xcode-select: error: command line tools are already installed, use "Software Update" to install updates

and, unsurprisingly, reinstalling mopidy-spotify via brew gives the same error:

creating build/temp.macosx-10.12-x86_64-2.7/c
clang -fno-strict-aliasing -fno-common -dynamic -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -DUSE__THREAD -I/usr/include/ffi -I/usr/include/libffi -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python/2.7.13_1/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c c/_cffi_backend.c -o build/temp.macosx-10.12-x86_64-2.7/c/_cffi_backend.o
c/_cffi_backend.c:2:10: fatal error: 'Python.h' file not found
#include <Python.h>
         ^~~~~~~~~~
1 error generated.
error: command 'clang' failed with exit status 1

Regards,

Tim

jodal commented 4 years ago

The formulas in this tap have now been updated to run on Python 3. The pyspotify formula also comes with the latest versions of cffi and pycparser. Hopefully, this is no longer a problem.