0x00 前言

mac 安装 hyperscan 没问题,但是python 安装 python-hyperscan 总是报错:

fatal error: 'hs/hs.h' file not found

0x01 python 环境

https://pythonlinks.python.jp/en/index.html

下载 3.9.10, 这是为了保证 Clang 是 13.0.0

安装完后,执行一下如图的脚本:

增加环境变量: ~/.zshrc

export PATH="/Users/{这是你的用户名}/Library/Python/3.9/bin:$PATH"

0x02 安装 hyperscan

brew install hyperscan

0x03 查看 pkg-config

brew install pkg-config
pkg-config --cflags --libs libhs

0x04 下载 python-hyperscan

git clone https://github.com/darvid/python-hyperscan.git

0x05 安装 python-hyperscan

源码安装

安装 poetry

python3 -m pip install poetry --user

poetry 安装 python-hyperscan

poetry install

pip 安装

python3 -m pip install hyperscan --user

最新的解决方案

python3 -m pip install hyperscan==0.2.0 --user
最后修改:2023 年 06 月 13 日 04 : 39 PM
如果觉得我的文章对你有用,请随意赞赏