mac os上python报错 fatal error: 'Python.h' file not found

1. 安装python (可安装任意版本)

brew install python@3.9

 

2. 创建虚拟环境

cd ~

/opt/homebrew/bin/python3.9 -m venv ai3.9

 

3. 激活虚拟环境

source ~/ai3.9/bin/activate

 

4. 安装

pip install xxx

 

posted @ 2023-03-28 20:51  Shiyu_Huang  阅读(711)  评论(0编辑  收藏  举报