新增文档
All checks were successful
continuous-integration/drone Build is passing

This commit is contained in:
2025-12-26 18:32:31 +08:00
parent 03afb52b2e
commit 5b0df06540

View File

@@ -0,0 +1,33 @@
> 本文作者:丁辉
# Mac使用Python环境
> 在 Mac 执行 Pip 安装包时报错
>
> ```bash
> error: externally-managed-environment
> ```
## 解决方案
1. 创建虚拟环境
```bash
python3 -m venv venv1
```
2. 激活虚拟环境
```bash
source venv1/bin/activate
```
3. 再次执行 Pip 安装命令成功
4. 运行脚本(完成)
5. 停用虚拟环境
```bash
deactivate
```