Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: Failed building wheel for python-snappy with Python 3.11.7 on macOS #127

Open
traceymeng opened this issue Dec 7, 2023 · 3 comments

Comments

@traceymeng
Copy link

I follow the installation to install python-sappy on macOS (macOS 14.0), but got following errors:

CPPFLAGS="-I/opt/homebrew/include -L/opt/homebrew/lib" pip3 install python-snappy
Looking in indexes: https://pypi.python.org/simple, https://pypi.apple.com/simple
Collecting python-snappy
Using cached https://pypi.apple.com/packages/packages/98/7a/44a24bad98335b2c72e4cadcdecf79f50197d1bab9f22f863a274f104b96/python-snappy-0.6.1.tar.gz (24 kB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: python-snappy
Building wheel for python-snappy (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [29 lines of output]
/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/setuptools/_distutils/dist.py:264: UserWarning: Unknown distribution option: 'cffi_modules'
warnings.warn(msg)
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.9-universal2-cpython-311
creating build/lib.macosx-10.9-universal2-cpython-311/snappy
copying src/snappy/snappy.py -> build/lib.macosx-10.9-universal2-cpython-311/snappy
copying src/snappy/snappy_cffi.py -> build/lib.macosx-10.9-universal2-cpython-311/snappy
copying src/snappy/init.py -> build/lib.macosx-10.9-universal2-cpython-311/snappy
copying src/snappy/hadoop_snappy.py -> build/lib.macosx-10.9-universal2-cpython-311/snappy
copying src/snappy/snappy_formats.py -> build/lib.macosx-10.9-universal2-cpython-311/snappy
copying src/snappy/main.py -> build/lib.macosx-10.9-universal2-cpython-311/snappy
copying src/snappy/snappy_cffi_builder.py -> build/lib.macosx-10.9-universal2-cpython-311/snappy
running build_ext
building 'snappy._snappy' extension
creating build/temp.macosx-10.9-universal2-cpython-311
creating build/temp.macosx-10.9-universal2-cpython-311/src
creating build/temp.macosx-10.9-universal2-cpython-311/src/snappy
clang -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -I/opt/homebrew/include -L/opt/homebrew/lib -I/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11 -c src/snappy/crc32c.c -o build/temp.macosx-10.9-universal2-cpython-311/src/snappy/crc32c.o
clang: warning: argument unused during compilation: '-L/opt/homebrew/lib' [-Wunused-command-line-argument]
clang -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -I/opt/homebrew/include -L/opt/homebrew/lib -I/Library/Frameworks/Python.framework/Versions/3.11/include/python3.11 -c src/snappy/snappymodule.cc -o build/temp.macosx-10.9-universal2-cpython-311/src/snappy/snappymodule.o
clang: warning: argument unused during compilation: '-L/opt/homebrew/lib' [-Wunused-command-line-argument]
src/snappy/snappymodule.cc:33:10: fatal error: 'snappy-c.h' file not found
#include <snappy-c.h>
^~~~~~~~~~~~
1 error generated.
error: command '/usr/bin/clang' failed with exit code 1
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for python-snappy
Running setup.py clean for python-snappy
Failed to build python-snappy
ERROR: Could not build wheels for python-snappy, which is required to install pyproject.toml-based projects

@martindurant
Copy link
Member

You need to have the snappy C dev libraries installed on your machine to build from source. I'm not sure why you are not getting the binary wheel, however. You may wish to install using conda instead.

@jeremymturner
Copy link

CPPFLAGS="-I/opt/homebrew/include -L/opt/homebrew/lib" pip install python-snappy

https://stackoverflow.com/questions/11416024/error-installing-python-snappy-snappy-c-h-no-such-file-or-directory

@gliptak
Copy link
Collaborator

gliptak commented Feb 23, 2024

please check https://pypi.org/project/python-snappy/0.7.0.dev1/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants