Skip to content

fatal error: 'Accelerate/Accelerate.h' file not found on MacOS #428

New issue

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

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

Already on GitHub? # to your account

Closed
2 tasks done
gileneusz opened this issue Jun 26, 2023 · 6 comments
Closed
2 tasks done

fatal error: 'Accelerate/Accelerate.h' file not found on MacOS #428

gileneusz opened this issue Jun 26, 2023 · 6 comments
Labels

Comments

@gileneusz
Copy link

Prerequisites

Please answer the following questions for yourself before submitting an issue.

  • [ x] I am running the latest code. Development is very rapid so there are no tagged versions as of now.
  • I carefully followed the README.md.
  • I searched using keywords relevant to my issue to make sure that I am creating a new issue that is not already open (or closed).
  • [x ] I reviewed the Discussions, and have a new bug or useful enhancement to share.

Expected Behavior

Please provide a detailed written description of what you were trying to do, and what you expected llama-cpp-python to do.

I just try to install llama

pip install llama-cpp-python==0.1.48

Current Behavior

Please provide a detailed written description of what llama-cpp-python did, instead.

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

Environment and Context

Please provide detailed information about your computer setup. This is important in case the issue is not reproducible except for under certain specific conditions.

M1 Mac 16 GB

$ python3 --version 
Python 3.9.16
$ make --version
GNU Make 3.81
$ g++ --version
Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.5 (clang-1205.0.22.9)
Target: arm64-apple-darwin22.2.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

Failure Information (for bugs)

Guys please help with this error I literally searched everywhere. Trying installing cmake, gcc, upgrading brew, etc. I'm so irritated that it doesn't work out of the box and any package installed that is dependent on llama fails just because of that.

@gjmulder
Copy link
Contributor

Can you post the full error log please, with the --verbose pip option

@gjmulder gjmulder added the build label Jun 26, 2023
@gileneusz
Copy link
Author

Thanks a lot for taking the time to respond


(llama) gileneo@ www % pip install --verbose llama-cpp-python 




Using pip 23.1.2 from /Users/gileneo/miniconda3/envs/llama/lib/python3.9/site-packages/pip (python 3.9)
Collecting llama-cpp-python
  Using cached llama_cpp_python-0.1.66.tar.gz (1.5 MB)
  Running command pip subprocess to install build dependencies
  Collecting setuptools>=42
    Using cached setuptools-68.0.0-py3-none-any.whl (804 kB)
  Collecting scikit-build>=0.13
    Using cached scikit_build-0.17.6-py3-none-any.whl (84 kB)
  Collecting cmake>=3.18
    Using cached cmake-3.26.4-py2.py3-none-macosx_10_10_universal2.macosx_10_10_x86_64.macosx_11_0_arm64.macosx_11_0_universal2.whl (45.6 MB)
  Collecting ninja
    Using cached ninja-1.11.1-py2.py3-none-macosx_10_9_universal2.macosx_10_9_x86_64.macosx_11_0_arm64.macosx_11_0_universal2.whl (270 kB)
  Collecting distro (from scikit-build>=0.13)
    Using cached distro-1.8.0-py3-none-any.whl (20 kB)
  Collecting packaging (from scikit-build>=0.13)
    Using cached packaging-23.1-py3-none-any.whl (48 kB)
  Collecting tomli (from scikit-build>=0.13)
    Using cached tomli-2.0.1-py3-none-any.whl (12 kB)
  Collecting wheel>=0.32.0 (from scikit-build>=0.13)
    Using cached wheel-0.40.0-py3-none-any.whl (64 kB)
  Installing collected packages: ninja, cmake, wheel, tomli, setuptools, packaging, distro, scikit-build
  Successfully installed cmake-3.26.4 distro-1.8.0 ninja-1.11.1 packaging-23.1 scikit-build-0.17.6 setuptools-68.0.0 tomli-2.0.1 wheel-0.40.0
  Installing build dependencies ... done
  Running command Getting requirements to build wheel
  running egg_info
  writing llama_cpp_python.egg-info/PKG-INFO
  writing dependency_links to llama_cpp_python.egg-info/dependency_links.txt
  writing requirements to llama_cpp_python.egg-info/requires.txt
  writing top-level names to llama_cpp_python.egg-info/top_level.txt
  reading manifest file 'llama_cpp_python.egg-info/SOURCES.txt'
  adding license file 'LICENSE.md'
  writing manifest file 'llama_cpp_python.egg-info/SOURCES.txt'
  Getting requirements to build wheel ... done
  Running command Preparing metadata (pyproject.toml)
  running dist_info
  creating /private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-modern-metadata-vo9k1ggz/llama_cpp_python.egg-info
  writing /private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-modern-metadata-vo9k1ggz/llama_cpp_python.egg-info/PKG-INFO
  writing dependency_links to /private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-modern-metadata-vo9k1ggz/llama_cpp_python.egg-info/dependency_links.txt
  writing requirements to /private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-modern-metadata-vo9k1ggz/llama_cpp_python.egg-info/requires.txt
  writing top-level names to /private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-modern-metadata-vo9k1ggz/llama_cpp_python.egg-info/top_level.txt
  writing manifest file '/private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-modern-metadata-vo9k1ggz/llama_cpp_python.egg-info/SOURCES.txt'
  reading manifest file '/private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-modern-metadata-vo9k1ggz/llama_cpp_python.egg-info/SOURCES.txt'
  adding license file 'LICENSE.md'
  writing manifest file '/private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-modern-metadata-vo9k1ggz/llama_cpp_python.egg-info/SOURCES.txt'
  creating '/private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-modern-metadata-vo9k1ggz/llama_cpp_python-0.1.66.dist-info'
  Preparing metadata (pyproject.toml) ... done
Collecting typing-extensions>=4.5.0 (from llama-cpp-python)
  Using cached typing_extensions-4.6.3-py3-none-any.whl (31 kB)
Collecting numpy>=1.20.0 (from llama-cpp-python)
  Using cached numpy-1.25.0-cp39-cp39-macosx_11_0_arm64.whl (14.0 MB)
Collecting diskcache>=5.6.1 (from llama-cpp-python)
  Using cached diskcache-5.6.1-py3-none-any.whl (45 kB)
Building wheels for collected packages: llama-cpp-python
  Running command Building wheel for llama-cpp-python (pyproject.toml)
  /private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-build-env-ysi_5xbw/overlay/lib/python3.9/site-packages/skbuild/setuptools_wrap.py:575: UserWarning: CMAKE_OSX_DEPLOYMENT_TARGET should not be empty if specified, ignoring
    warnings.warn(msg, stacklevel=1)


  --------------------------------------------------------------------------------
  -- Trying 'Ninja' generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  Not searching for unused variables given on the command line.
  -- The C compiler identification is Clang 14.0.6
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: /Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-clang - skipped
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- The CXX compiler identification is Clang 14.0.6
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Check for working CXX compiler: /Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-clang++ - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  -- Configuring done (1.3s)
  -- Generating done (0.0s)
  -- Build files have been written to: /private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-install-q2sx3rgr/llama-cpp-python_b40f05c217c445ca8ee2e488a359754b/_cmake_test_compile/build
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying 'Ninja' generator - success
  --------------------------------------------------------------------------------

  Configuring Project
    Working directory:
      /private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-install-q2sx3rgr/llama-cpp-python_b40f05c217c445ca8ee2e488a359754b/_skbuild/macosx-13.0-arm64-3.9/cmake-build
    Command:
      /private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-build-env-ysi_5xbw/overlay/lib/python3.9/site-packages/cmake/data/bin/cmake /private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-install-q2sx3rgr/llama-cpp-python_b40f05c217c445ca8ee2e488a359754b -G Ninja -DCMAKE_MAKE_PROGRAM:FILEPATH=/private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-build-env-ysi_5xbw/overlay/lib/python3.9/site-packages/ninja/data/bin/ninja --no-warn-unused-cli -DCMAKE_INSTALL_PREFIX:PATH=/private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-install-q2sx3rgr/llama-cpp-python_b40f05c217c445ca8ee2e488a359754b/_skbuild/macosx-13.0-arm64-3.9/cmake-install -DPYTHON_VERSION_STRING:STRING=3.9.16 -DSKBUILD:INTERNAL=TRUE -DCMAKE_MODULE_PATH:PATH=/private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-build-env-ysi_5xbw/overlay/lib/python3.9/site-packages/skbuild/resources/cmake -DPYTHON_EXECUTABLE:PATH=/Users/gileneo/miniconda3/envs/llama/bin/python -DPYTHON_INCLUDE_DIR:PATH=/Users/gileneo/miniconda3/envs/llama/include/python3.9 -DPYTHON_LIBRARY:PATH=/Users/gileneo/miniconda3/envs/llama/lib/libpython3.9.dylib -DPython_EXECUTABLE:PATH=/Users/gileneo/miniconda3/envs/llama/bin/python -DPython_ROOT_DIR:PATH=/Users/gileneo/miniconda3/envs/llama -DPython_FIND_REGISTRY:STRING=NEVER -DPython_INCLUDE_DIR:PATH=/Users/gileneo/miniconda3/envs/llama/include/python3.9 -DPython3_EXECUTABLE:PATH=/Users/gileneo/miniconda3/envs/llama/bin/python -DPython3_ROOT_DIR:PATH=/Users/gileneo/miniconda3/envs/llama -DPython3_FIND_REGISTRY:STRING=NEVER -DPython3_INCLUDE_DIR:PATH=/Users/gileneo/miniconda3/envs/llama/include/python3.9 -DCMAKE_MAKE_PROGRAM:FILEPATH=/private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-build-env-ysi_5xbw/overlay/lib/python3.9/site-packages/ninja/data/bin/ninja -DCMAKE_AR=/Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-ar -DCMAKE_CXX_COMPILER_AR=/Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-ar -DCMAKE_C_COMPILER_AR=/Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-ar -DCMAKE_RANLIB=/Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-ranlib -DCMAKE_CXX_COMPILER_RANLIB=/Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-ranlib -DCMAKE_C_COMPILER_RANLIB=/Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-ranlib -DCMAKE_LINKER=/Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-ld -DCMAKE_STRIP=/Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-strip -DCMAKE_INSTALL_NAME_TOOL=/Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-install_name_tool -DCMAKE_LIBTOOL=/Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-libtool -DCMAKE_OSX_DEPLOYMENT_TARGET= -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=13.0 -DCMAKE_OSX_ARCHITECTURES:STRING=arm64 -DCMAKE_AR=/Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-ar -DCMAKE_CXX_COMPILER_AR=/Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-ar -DCMAKE_C_COMPILER_AR=/Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-ar -DCMAKE_RANLIB=/Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-ranlib -DCMAKE_CXX_COMPILER_RANLIB=/Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-ranlib -DCMAKE_C_COMPILER_RANLIB=/Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-ranlib -DCMAKE_LINKER=/Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-ld -DCMAKE_STRIP=/Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-strip -DCMAKE_INSTALL_NAME_TOOL=/Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-install_name_tool -DCMAKE_LIBTOOL=/Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-libtool -DCMAKE_OSX_DEPLOYMENT_TARGET= -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk

  Not searching for unused variables given on the command line.
  -- The C compiler identification is Clang 14.0.6
  -- The CXX compiler identification is Clang 14.0.6
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: /Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-clang - skipped
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Check for working CXX compiler: /Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-clang++ - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  -- Configuring done (0.4s)
  -- Generating done (0.0s)
  -- Build files have been written to: /private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-install-q2sx3rgr/llama-cpp-python_b40f05c217c445ca8ee2e488a359754b/_skbuild/macosx-13.0-arm64-3.9/cmake-build
  [1/2] Generating /private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-install-q2sx3rgr/llama-cpp-python_b40f05c217c445ca8ee2e488a359754b/vendor/llama.cpp/libllama.so
  FAILED: /private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-install-q2sx3rgr/llama-cpp-python_b40f05c217c445ca8ee2e488a359754b/vendor/llama.cpp/libllama.so
  cd /private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-install-q2sx3rgr/llama-cpp-python_b40f05c217c445ca8ee2e488a359754b/vendor/llama.cpp && make libllama.so
  I llama.cpp build info:
  I UNAME_S:  Darwin
  I UNAME_P:  arm
  I UNAME_M:  arm64
  I CFLAGS:   -I.              -O3 -std=c11   -fPIC -DNDEBUG -Wall -Wextra -Wpedantic -Wcast-qual -Wdouble-promotion -Wshadow -Wstrict-prototypes -Wpointer-arith -pthread -DGGML_USE_K_QUANTS -DGGML_USE_ACCELERATE
  I CXXFLAGS: -I. -I./examples -O3 -std=c++11 -fPIC -DNDEBUG -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function -Wno-multichar -pthread -DGGML_USE_K_QUANTS
  I LDFLAGS:   -framework Accelerate
  I CC:       clang version 14.0.6
  I CXX:      clang version 14.0.6

  arm64-apple-darwin20.0.0-clang++ -I. -I./examples -O3 -std=c++11 -fPIC -DNDEBUG -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function -Wno-multichar -pthread -DGGML_USE_K_QUANTS -c llama.cpp -o llama.o
  arm64-apple-darwin20.0.0-clang  -I.              -O3 -std=c11   -fPIC -DNDEBUG -Wall -Wextra -Wpedantic -Wcast-qual -Wdouble-promotion -Wshadow -Wstrict-prototypes -Wpointer-arith -pthread -DGGML_USE_K_QUANTS -DGGML_USE_ACCELERATE   -c ggml.c -o ggml.o
  ggml.c:198:10: fatal error: 'Accelerate/Accelerate.h' file not found
  #include <Accelerate/Accelerate.h>
           ^~~~~~~~~~~~~~~~~~~~~~~~~
  1 error generated.
  make: *** [ggml.o] Error 1
  ninja: build stopped: subcommand failed.
  Traceback (most recent call last):
    File "/private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-build-env-ysi_5xbw/overlay/lib/python3.9/site-packages/skbuild/setuptools_wrap.py", line 674, in setup
      cmkr.make(make_args, install_target=cmake_install_target, env=env)
    File "/private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-build-env-ysi_5xbw/overlay/lib/python3.9/site-packages/skbuild/cmaker.py", line 697, in make
      self.make_impl(clargs=clargs, config=config, source_dir=source_dir, install_target=install_target, env=env)
    File "/private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-build-env-ysi_5xbw/overlay/lib/python3.9/site-packages/skbuild/cmaker.py", line 742, in make_impl
      raise SKBuildError(msg)

  An error occurred while building with CMake.
    Command:
      /private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-build-env-ysi_5xbw/overlay/lib/python3.9/site-packages/cmake/data/bin/cmake --build . --target install --config Release --
    Install target:
      install
    Source directory:
      /private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-install-q2sx3rgr/llama-cpp-python_b40f05c217c445ca8ee2e488a359754b
    Working directory:
      /private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-install-q2sx3rgr/llama-cpp-python_b40f05c217c445ca8ee2e488a359754b/_skbuild/macosx-13.0-arm64-3.9/cmake-build
  Please check the install target is valid and see CMake's output for more information.

  error: subprocess-exited-with-error
  
  × Building wheel for llama-cpp-python (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /Users/gileneo/miniconda3/envs/llama/bin/python /Users/gileneo/miniconda3/envs/llama/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/tmp0jm7jpbr
  cwd: /private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-install-q2sx3rgr/llama-cpp-python_b40f05c217c445ca8ee2e488a359754b
  Building wheel for llama-cpp-python (pyproject.toml) ... error
  ERROR: Failed building wheel for llama-cpp-python
Failed to build llama-cpp-python
ERROR: Could not build wheels for llama-cpp-python, which is required to install pyproject.toml-based projects


@mozzipa
Copy link

mozzipa commented Jun 27, 2023

Try as below
pip uninstall llama-cpp-python
arch -arm64 pip install llama-cpp-python --no-cache-dir

@gjmulder gjmulder changed the title Can anyone solve the installation process for M1 Mac? fatal error: 'Accelerate/Accelerate.h' file not found on MacOS Jun 27, 2023
@gjmulder
Copy link
Contributor

gjmulder commented Jun 27, 2023

I suspect you either do not have the MacOS accelerate libraries installed, or if you do they cannot be found.

@gileneusz
Copy link
Author

I tied to install it, and the same error:

(llama) gileneo@ www % pip install accelerate
Collecting accelerate
  Using cached accelerate-0.20.3-py3-none-any.whl (227 kB)
Collecting numpy>=1.17 (from accelerate)
  Using cached numpy-1.25.0-cp39-cp39-macosx_11_0_arm64.whl (14.0 MB)
Collecting packaging>=20.0 (from accelerate)
  Using cached packaging-23.1-py3-none-any.whl (48 kB)
Collecting psutil (from accelerate)
  Using cached psutil-5.9.5-cp38-abi3-macosx_11_0_arm64.whl (246 kB)
Collecting pyyaml (from accelerate)
  Using cached PyYAML-6.0-cp39-cp39-macosx_11_0_arm64.whl (173 kB)
Collecting torch>=1.6.0 (from accelerate)
  Downloading torch-2.0.1-cp39-none-macosx_11_0_arm64.whl (55.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 55.8/55.8 MB 6.7 MB/s eta 0:00:00
Collecting filelock (from torch>=1.6.0->accelerate)
  Using cached filelock-3.12.2-py3-none-any.whl (10 kB)
Collecting typing-extensions (from torch>=1.6.0->accelerate)
  Using cached typing_extensions-4.6.3-py3-none-any.whl (31 kB)
Collecting sympy (from torch>=1.6.0->accelerate)
  Using cached sympy-1.12-py3-none-any.whl (5.7 MB)
Collecting networkx (from torch>=1.6.0->accelerate)
  Using cached networkx-3.1-py3-none-any.whl (2.1 MB)
Collecting jinja2 (from torch>=1.6.0->accelerate)
  Using cached Jinja2-3.1.2-py3-none-any.whl (133 kB)
Collecting MarkupSafe>=2.0 (from jinja2->torch>=1.6.0->accelerate)
  Downloading MarkupSafe-2.1.3-cp39-cp39-macosx_10_9_universal2.whl (17 kB)
Collecting mpmath>=0.19 (from sympy->torch>=1.6.0->accelerate)
  Using cached mpmath-1.3.0-py3-none-any.whl (536 kB)
Installing collected packages: mpmath, typing-extensions, sympy, pyyaml, psutil, packaging, numpy, networkx, MarkupSafe, filelock, jinja2, torch, accelerate
Successfully installed MarkupSafe-2.1.3 accelerate-0.20.3 filelock-3.12.2 jinja2-3.1.2 mpmath-1.3.0 networkx-3.1 numpy-1.25.0 packaging-23.1 psutil-5.9.5 pyyaml-6.0 sympy-1.12 torch-2.0.1 typing-extensions-4.6.3
(llama) gileneo@ www % pip install --verbose llama-cpp-python                   




Using pip 23.1.2 from /Users/gileneo/miniconda3/envs/llama/lib/python3.9/site-packages/pip (python 3.9)
Collecting llama-cpp-python
  Using cached llama_cpp_python-0.1.66.tar.gz (1.5 MB)
  Running command pip subprocess to install build dependencies
  Collecting setuptools>=42
    Using cached setuptools-68.0.0-py3-none-any.whl (804 kB)
  Collecting scikit-build>=0.13
    Using cached scikit_build-0.17.6-py3-none-any.whl (84 kB)
  Collecting cmake>=3.18
    Using cached cmake-3.26.4-py2.py3-none-macosx_10_10_universal2.macosx_10_10_x86_64.macosx_11_0_arm64.macosx_11_0_universal2.whl (45.6 MB)
  Collecting ninja
    Using cached ninja-1.11.1-py2.py3-none-macosx_10_9_universal2.macosx_10_9_x86_64.macosx_11_0_arm64.macosx_11_0_universal2.whl (270 kB)
  Collecting distro (from scikit-build>=0.13)
    Using cached distro-1.8.0-py3-none-any.whl (20 kB)
  Collecting packaging (from scikit-build>=0.13)
    Using cached packaging-23.1-py3-none-any.whl (48 kB)
  Collecting tomli (from scikit-build>=0.13)
    Using cached tomli-2.0.1-py3-none-any.whl (12 kB)
  Collecting wheel>=0.32.0 (from scikit-build>=0.13)
    Using cached wheel-0.40.0-py3-none-any.whl (64 kB)
  Installing collected packages: ninja, cmake, wheel, tomli, setuptools, packaging, distro, scikit-build
  Successfully installed cmake-3.26.4 distro-1.8.0 ninja-1.11.1 packaging-23.1 scikit-build-0.17.6 setuptools-68.0.0 tomli-2.0.1 wheel-0.40.0
  Installing build dependencies ... done
  Running command Getting requirements to build wheel
  running egg_info
  writing llama_cpp_python.egg-info/PKG-INFO
  writing dependency_links to llama_cpp_python.egg-info/dependency_links.txt
  writing requirements to llama_cpp_python.egg-info/requires.txt
  writing top-level names to llama_cpp_python.egg-info/top_level.txt
  reading manifest file 'llama_cpp_python.egg-info/SOURCES.txt'
  adding license file 'LICENSE.md'
  writing manifest file 'llama_cpp_python.egg-info/SOURCES.txt'
  Getting requirements to build wheel ... done
  Running command Preparing metadata (pyproject.toml)
  running dist_info
  creating /private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-modern-metadata-gy91trfv/llama_cpp_python.egg-info
  writing /private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-modern-metadata-gy91trfv/llama_cpp_python.egg-info/PKG-INFO
  writing dependency_links to /private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-modern-metadata-gy91trfv/llama_cpp_python.egg-info/dependency_links.txt
  writing requirements to /private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-modern-metadata-gy91trfv/llama_cpp_python.egg-info/requires.txt
  writing top-level names to /private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-modern-metadata-gy91trfv/llama_cpp_python.egg-info/top_level.txt
  writing manifest file '/private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-modern-metadata-gy91trfv/llama_cpp_python.egg-info/SOURCES.txt'
  reading manifest file '/private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-modern-metadata-gy91trfv/llama_cpp_python.egg-info/SOURCES.txt'
  adding license file 'LICENSE.md'
  writing manifest file '/private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-modern-metadata-gy91trfv/llama_cpp_python.egg-info/SOURCES.txt'
  creating '/private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-modern-metadata-gy91trfv/llama_cpp_python-0.1.66.dist-info'
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: typing-extensions>=4.5.0 in /Users/gileneo/miniconda3/envs/llama/lib/python3.9/site-packages (from llama-cpp-python) (4.6.3)
Requirement already satisfied: numpy>=1.20.0 in /Users/gileneo/miniconda3/envs/llama/lib/python3.9/site-packages (from llama-cpp-python) (1.25.0)
Collecting diskcache>=5.6.1 (from llama-cpp-python)
  Using cached diskcache-5.6.1-py3-none-any.whl (45 kB)
Building wheels for collected packages: llama-cpp-python
  Running command Building wheel for llama-cpp-python (pyproject.toml)
  /private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-build-env-2357ovu6/overlay/lib/python3.9/site-packages/skbuild/setuptools_wrap.py:575: UserWarning: CMAKE_OSX_DEPLOYMENT_TARGET should not be empty if specified, ignoring
    warnings.warn(msg, stacklevel=1)


  --------------------------------------------------------------------------------
  -- Trying 'Ninja' generator
  --------------------------------
  ---------------------------
  ----------------------
  -----------------
  ------------
  -------
  --
  Not searching for unused variables given on the command line.
  -- The C compiler identification is Clang 14.0.6
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: /Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-clang - skipped
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- The CXX compiler identification is Clang 14.0.6
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Check for working CXX compiler: /Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-clang++ - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  -- Configuring done (0.9s)
  -- Generating done (0.0s)
  -- Build files have been written to: /private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-install-dmlx886u/llama-cpp-python_4375bce4d95043c09ba343bec8a5ec66/_cmake_test_compile/build
  --
  -------
  ------------
  -----------------
  ----------------------
  ---------------------------
  --------------------------------
  -- Trying 'Ninja' generator - success
  --------------------------------------------------------------------------------

  Configuring Project
    Working directory:
      /private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-install-dmlx886u/llama-cpp-python_4375bce4d95043c09ba343bec8a5ec66/_skbuild/macosx-13.0-arm64-3.9/cmake-build
    Command:
      /private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-build-env-2357ovu6/overlay/lib/python3.9/site-packages/cmake/data/bin/cmake /private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-install-dmlx886u/llama-cpp-python_4375bce4d95043c09ba343bec8a5ec66 -G Ninja -DCMAKE_MAKE_PROGRAM:FILEPATH=/private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-build-env-2357ovu6/overlay/lib/python3.9/site-packages/ninja/data/bin/ninja --no-warn-unused-cli -DCMAKE_INSTALL_PREFIX:PATH=/private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-install-dmlx886u/llama-cpp-python_4375bce4d95043c09ba343bec8a5ec66/_skbuild/macosx-13.0-arm64-3.9/cmake-install -DPYTHON_VERSION_STRING:STRING=3.9.16 -DSKBUILD:INTERNAL=TRUE -DCMAKE_MODULE_PATH:PATH=/private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-build-env-2357ovu6/overlay/lib/python3.9/site-packages/skbuild/resources/cmake -DPYTHON_EXECUTABLE:PATH=/Users/gileneo/miniconda3/envs/llama/bin/python -DPYTHON_INCLUDE_DIR:PATH=/Users/gileneo/miniconda3/envs/llama/include/python3.9 -DPYTHON_LIBRARY:PATH=/Users/gileneo/miniconda3/envs/llama/lib/libpython3.9.dylib -DPython_EXECUTABLE:PATH=/Users/gileneo/miniconda3/envs/llama/bin/python -DPython_ROOT_DIR:PATH=/Users/gileneo/miniconda3/envs/llama -DPython_FIND_REGISTRY:STRING=NEVER -DPython_INCLUDE_DIR:PATH=/Users/gileneo/miniconda3/envs/llama/include/python3.9 -DPython3_EXECUTABLE:PATH=/Users/gileneo/miniconda3/envs/llama/bin/python -DPython3_ROOT_DIR:PATH=/Users/gileneo/miniconda3/envs/llama -DPython3_FIND_REGISTRY:STRING=NEVER -DPython3_INCLUDE_DIR:PATH=/Users/gileneo/miniconda3/envs/llama/include/python3.9 -DCMAKE_MAKE_PROGRAM:FILEPATH=/private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-build-env-2357ovu6/overlay/lib/python3.9/site-packages/ninja/data/bin/ninja -DCMAKE_AR=/Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-ar -DCMAKE_CXX_COMPILER_AR=/Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-ar -DCMAKE_C_COMPILER_AR=/Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-ar -DCMAKE_RANLIB=/Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-ranlib -DCMAKE_CXX_COMPILER_RANLIB=/Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-ranlib -DCMAKE_C_COMPILER_RANLIB=/Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-ranlib -DCMAKE_LINKER=/Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-ld -DCMAKE_STRIP=/Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-strip -DCMAKE_INSTALL_NAME_TOOL=/Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-install_name_tool -DCMAKE_LIBTOOL=/Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-libtool -DCMAKE_OSX_DEPLOYMENT_TARGET= -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk -DCMAKE_OSX_DEPLOYMENT_TARGET:STRING=13.0 -DCMAKE_OSX_ARCHITECTURES:STRING=arm64 -DCMAKE_AR=/Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-ar -DCMAKE_CXX_COMPILER_AR=/Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-ar -DCMAKE_C_COMPILER_AR=/Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-ar -DCMAKE_RANLIB=/Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-ranlib -DCMAKE_CXX_COMPILER_RANLIB=/Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-ranlib -DCMAKE_C_COMPILER_RANLIB=/Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-ranlib -DCMAKE_LINKER=/Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-ld -DCMAKE_STRIP=/Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-strip -DCMAKE_INSTALL_NAME_TOOL=/Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-install_name_tool -DCMAKE_LIBTOOL=/Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-libtool -DCMAKE_OSX_DEPLOYMENT_TARGET= -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_SYSROOT=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk

  Not searching for unused variables given on the command line.
  -- The C compiler identification is Clang 14.0.6
  -- The CXX compiler identification is Clang 14.0.6
  -- Detecting C compiler ABI info
  -- Detecting C compiler ABI info - done
  -- Check for working C compiler: /Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-clang - skipped
  -- Detecting C compile features
  -- Detecting C compile features - done
  -- Detecting CXX compiler ABI info
  -- Detecting CXX compiler ABI info - done
  -- Check for working CXX compiler: /Users/gileneo/miniconda3/envs/llama/bin/arm64-apple-darwin20.0.0-clang++ - skipped
  -- Detecting CXX compile features
  -- Detecting CXX compile features - done
  -- Configuring done (0.4s)
  -- Generating done (0.0s)
  -- Build files have been written to: /private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-install-dmlx886u/llama-cpp-python_4375bce4d95043c09ba343bec8a5ec66/_skbuild/macosx-13.0-arm64-3.9/cmake-build
  [1/2] Generating /private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-install-dmlx886u/llama-cpp-python_4375bce4d95043c09ba343bec8a5ec66/vendor/llama.cpp/libllama.so
  FAILED: /private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-install-dmlx886u/llama-cpp-python_4375bce4d95043c09ba343bec8a5ec66/vendor/llama.cpp/libllama.so
  cd /private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-install-dmlx886u/llama-cpp-python_4375bce4d95043c09ba343bec8a5ec66/vendor/llama.cpp && make libllama.so
  I llama.cpp build info:
  I UNAME_S:  Darwin
  I UNAME_P:  arm
  I UNAME_M:  arm64
  I CFLAGS:   -I.              -O3 -std=c11   -fPIC -DNDEBUG -Wall -Wextra -Wpedantic -Wcast-qual -Wdouble-promotion -Wshadow -Wstrict-prototypes -Wpointer-arith -pthread -DGGML_USE_K_QUANTS -DGGML_USE_ACCELERATE
  I CXXFLAGS: -I. -I./examples -O3 -std=c++11 -fPIC -DNDEBUG -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function -Wno-multichar -pthread -DGGML_USE_K_QUANTS
  I LDFLAGS:   -framework Accelerate
  I CC:       clang version 14.0.6
  I CXX:      clang version 14.0.6

  arm64-apple-darwin20.0.0-clang++ -I. -I./examples -O3 -std=c++11 -fPIC -DNDEBUG -Wall -Wextra -Wpedantic -Wcast-qual -Wno-unused-function -Wno-multichar -pthread -DGGML_USE_K_QUANTS -c llama.cpp -o llama.o
  arm64-apple-darwin20.0.0-clang  -I.              -O3 -std=c11   -fPIC -DNDEBUG -Wall -Wextra -Wpedantic -Wcast-qual -Wdouble-promotion -Wshadow -Wstrict-prototypes -Wpointer-arith -pthread -DGGML_USE_K_QUANTS -DGGML_USE_ACCELERATE   -c ggml.c -o ggml.o
  ggml.c:198:10: fatal error: 'Accelerate/Accelerate.h' file not found
  #include <Accelerate/Accelerate.h>
           ^~~~~~~~~~~~~~~~~~~~~~~~~
  1 error generated.
  make: *** [ggml.o] Error 1
  ninja: build stopped: subcommand failed.
  Traceback (most recent call last):
    File "/private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-build-env-2357ovu6/overlay/lib/python3.9/site-packages/skbuild/setuptools_wrap.py", line 674, in setup
      cmkr.make(make_args, install_target=cmake_install_target, env=env)
    File "/private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-build-env-2357ovu6/overlay/lib/python3.9/site-packages/skbuild/cmaker.py", line 697, in make
      self.make_impl(clargs=clargs, config=config, source_dir=source_dir, install_target=install_target, env=env)
    File "/private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-build-env-2357ovu6/overlay/lib/python3.9/site-packages/skbuild/cmaker.py", line 742, in make_impl
      raise SKBuildError(msg)

  An error occurred while building with CMake.
    Command:
      /private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-build-env-2357ovu6/overlay/lib/python3.9/site-packages/cmake/data/bin/cmake --build . --target install --config Release --
    Install target:
      install
    Source directory:
      /private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-install-dmlx886u/llama-cpp-python_4375bce4d95043c09ba343bec8a5ec66
    Working directory:
      /private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-install-dmlx886u/llama-cpp-python_4375bce4d95043c09ba343bec8a5ec66/_skbuild/macosx-13.0-arm64-3.9/cmake-build
  Please check the install target is valid and see CMake's output for more information.

  error: subprocess-exited-with-error
  
  × Building wheel for llama-cpp-python (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  full command: /Users/gileneo/miniconda3/envs/llama/bin/python /Users/gileneo/miniconda3/envs/llama/lib/python3.9/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/tmp7bftxu1j
  cwd: /private/var/folders/ts/dwbwfd6j2jxgnj0zdc7_8qxh0000gn/T/pip-install-dmlx886u/llama-cpp-python_4375bce4d95043c09ba343bec8a5ec66
  Building wheel for llama-cpp-python (pyproject.toml) ... error
  ERROR: Failed building wheel for llama-cpp-python
Failed to build llama-cpp-python
ERROR: Could not build wheels for llama-cpp-python, which is required to install pyproject.toml-based projects

@gileneusz
Copy link
Author

for everyone with the same issue, I followed this advice: ggml-org/llama.cpp#279 (comment)

and guide:

https://mac.install.guide/commandlinetools/6.html

and it installed successfully. thank you all for helping me!

Successfully built llama-cpp-python
Installing collected packages: diskcache, llama-cpp-python
Successfully installed diskcache-5.6.1 llama-cpp-python-0.1.66

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

No branches or pull requests

3 participants