【笔记】如何卸载 MSYS2 中不同工具链的 numpy 包
📝 笔记:如何卸载 MSYS2 中不同工具链的 numpy
包
🧰 目标说明
本笔记教你如何在 MSYS2 环境中彻底卸载 numpy 包,包括:
- MINGW64 工具链(默认开发环境)
- Clang-x86_64 工具链(用于跨平台开发)
✅ 卸载 MINGW64 工具链中的 numpy
📌 包名:
mingw-w64-x86_64-python-numpy
🚪 适用场景:
你正在使用 MSYS2 的默认终端:MSYS2 MINGW64
🛠️ 卸载命令:
pacman -R mingw-w64-x86_64-python-numpy
📋 示例输出:
checking dependencies...Packages (1) mingw-w64-x86_64-python-numpy-2.2.4-1Total Removed Size: 53.05 MiB:: Do you want to remove these packages? [Y/n] y
:: Processing package changes...
(1/1) removing mingw-w64-x86_64-python-numpy [###############################] 100%
🔍 验证是否卸载成功:
pacman -Q mingw-w64-x86_64-python-numpy
如果提示如下,则表示已卸载成功:
error: package 'mingw-w64-x86_64-python-numpy' was not found
✅ 卸载 Clang 工具链中的 numpy
📌 包名:
mingw-w64-clang-x86_64-python-numpy
🚪 适用场景:
你正在使用 MSYS2 的 Clang64 终端,用于跨平台编译等用途。
🛠️ 卸载命令:
pacman -R mingw-w64-clang-x86_64-python-numpy
📋 示例输出:
checking dependencies...Packages (1) mingw-w64-clang-x86_64-python-numpy-2.2.4-1Total Removed Size: 48.74 MiB:: Do you want to remove these packages? [Y/n] y
:: Processing package changes...
(1/1) removing mingw-w64-clang-x86_64-python-numpy [###############################] 100%
🔍 验证是否卸载成功:
pacman -Q mingw-w64-clang-x86_64-python-numpy
如果提示如下,则表示已卸载成功:
error: package 'mingw-w64-clang-x86_64-python-numpy' was not found
🧪 补充建议:验证 Python 是否还能导入 numpy
python -c "import numpy"
- 如果提示
ModuleNotFoundError
,说明卸载彻底 ✅ - 如果仍然可以导入,说明还有其他版本的 numpy 被安装(如通过 pip 安装)
📦 小结对比表
操作 | MINGW64 工具链 | Clang 工具链 |
---|---|---|
包名 | mingw-w64-x86_64-python-numpy | mingw-w64-clang-x86_64-python-numpy |
卸载命令 | pacman -R mingw-w64-x86_64-python-numpy | pacman -R mingw-w64-clang-x86_64-python-numpy |
验证命令 | pacman -Q mingw-w64-x86_64-python-numpy | pacman -Q mingw-w64-clang-x86_64-python-numpy |
是否适合默认开发? | ✅ 是 | ❌ 否 |