惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

F
Fortinet All Blogs
罗磊的独立博客
IT之家
IT之家
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
月光博客
月光博客
博客园 - Franky
博客园 - 聂微东
博客园_首页
爱范儿
爱范儿
量子位
博客园 - 三生石上(FineUI控件)
G
Google Developers Blog
Martin Fowler
Martin Fowler
小众软件
小众软件
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Y
Y Combinator Blog
Vercel News
Vercel News
腾讯CDC
Microsoft Azure Blog
Microsoft Azure Blog
Hugging Face - Blog
Hugging Face - Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
The Cloudflare Blog
Engineering at Meta
Engineering at Meta

Pierce Freeman

A browser for agents | Pierce Freeman The grey market of podcast appearances The way I travel | Pierce Freeman Fixing slow AWS uploads | Pierce Freeman Local tools should still use vaults We solved scratch content first Starting a podcast in 2025 Being late but still being early Automating our home video imports Adding my parents to tailscale A deep dive on agent sandboxes Language servers for AI | Pierce Freeman My simple home podcast studio We need centralized infrastructure | Pierce Freeman Coercing agents to follow conventions using AST validation My unified theory of social selling My personal backup strategy | Pierce Freeman July updates to the homelab How the KV Cache works httpx is the right way to do web requests in Python Reputation is becoming everything | Pierce Freeman Building a (kind of) invisible mac app Updated knowledge in language models Making an ascii animation | Pierce Freeman How speculative decoding works | Pierce Freeman Under the hood of Claude Code Doing things because they're easy, not hard Speeding up sideeffects with JIT in mountaineer Firehot for hot reloading in Python Misadventures in Python hot reloading
Installing FastText on an M1 Mac
2022-05-05 · via Pierce Freeman

We rely on FastText in some of our NLP microservices. Since upgrading to an M1 Macbook, these dependencies have failed to build wheels.

Collecting fasttext
  Using cached fasttext-0.9.2.tar.gz (68 kB)
  Preparing metadata (setup.py) ... done
Collecting pybind11>=2.2
  Using cached pybind11-2.9.2-py2.py3-none-any.whl (213 kB)
Requirement already satisfied: setuptools>=0.7.0 in /Users/piercefreeman/.virtualenvs/myenv/lib/python3.10/site-packages (from fasttext) (62.0.0)
Collecting numpy
  Using cached numpy-1.22.3-cp310-cp310-macosx_11_0_arm64.whl (12.8 MB)
Building wheels for collected packages: fasttext
  Building wheel for fasttext (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.

  [...]

      src/autotune.cc:25:14: note: expanded from macro 'LOG_VAL_NAN'
          if (std::isnan(val)) {                          \
                   ^
      /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/math.h:165:5: note: expanded from macro 'isnan'
          ( sizeof(x) == sizeof(float)  ? __inline_isnanf((float)(x))          \
          ^
      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 fasttext

After some digging, the default C headers that are shipping with XCode are causing a definition conflict. Removing them fixes the problem. We move these to a temporary folder so we can restore them later, since they are functional for most of the other clang system installs.

sudo mv /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include_tmp

pip install fasttext

sudo mv /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include_tmp /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include

And we have a successful install:

Successfully built fasttext
Installing collected packages: pybind11, numpy, fasttext