bigscience-workshop / petals

🌸 Run LLMs at home, BitTorrent-style. Fine-tuning and inference up to 10x faster than offloading
https://petals.dev
MIT License
8.89k stars 490 forks source link

M1 macOS installation error ("failed to build wheel for hivemind") with mac-native petals #540

Closed MinaAlmasi closed 7 months ago

MinaAlmasi commented 7 months ago

Hi there! Thanks for the great work!

I am currently experiencing issues with getting petals (v2.2.0) to install on my M1 Macbook Pro (full specifications at the end). I have tried various python versions via HomeBrew (3.10.0 and 3.11.6) without luck.

When running: pip install git+https://github.com/bigscience-workshop/petals

I get the following error:

Building wheels for collected packages: hivemind
  Building wheel for hivemind (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for hivemind (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      <string>:12: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
      running bdist_wheel
      running build
      running build_py
      Downloading https://github.com/learning-at-home/go-libp2p-daemon/releases/download/v0.3.18/p2pd-darwin-arm64
      error: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006)>
      [end of output]

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

Trying to install hivemind prior to this yields the same error (v1.1.10)

I have tried installing petals following the exact instructions on the GitHub, installing Python via HomeBrew. I have also tried following instructions in the closed issue #147, installing the non-native petals version and a lower version of hivemind. This installs, but running code does not work.

SPECIFICATIONS: Macbook: Macbook Pro '13 2020 Chip: M1 Ram: 16 GB System Version: macOS 13.6.1 (Ventura) Python: 3.11.6 via HomeBrew (attempted on 3.10.0 also).

Let me know if I need to provide more information. Thanks in advance!

mryab commented 7 months ago

Hi! I tried to install petals right now on a Mac system, and the command you ran has succeeded. I think the root of the issue is the SSL: CERTIFICATE_VERIFY_FAILED you see in the logs, which hints at some network connection problems on your side.

Can you try running the command on a different Mac system or investigating whether pip works correctly in your case?

MinaAlmasi commented 7 months ago

Hi! Thank you for the super quick response! I was able to fix this by running the script Install Certificates.command in the terminal

(located within my corresponding python installation: /Applications/Python 3.11/Install Certificates.command)

Thanks again and sorry to take your time!