macOS M1安装wxPython报错‘tiff.h‘ file not found的解决方法

macOS12.6.6 M1安装wxPython失败:

报错如下:

shell 复制代码
imagtiff.cpp:37:14: fatal error: 'tiff.h' file not found

解决办法:

下载源文件重新编译(很快,5分钟全部搞定),分三步走:

第一步:下载源文件并解压,然后修改2个源文件

shell 复制代码
pip download wxPython==4.1.1
tar -zxvf wxPython-4.1.1.tar.gz
shell 复制代码
cd ./wxPython-4.1.1/ext/wxWidgets/src/common/
vim imagtiff.cpp

修改这4句头文件:

c 复制代码
#include "../tiff/libtiff/tiff.h"
#include "../tiff/libtiff/tiffio.h"
    //#include "tiff.h"
    //#include "tiffio.h"

保存退出,然后

shell 复制代码
cd ./wxPython-4.1.1/ext/wxWidgets/src/tiff/libtiff/
vim tiff.h

修改这一句:

c 复制代码
#include "tiffconf.h"

保存退出,OK

第二步:进入重新编译

shell 复制代码
python3 setup.py build

第三步:再次安装

shell 复制代码
python3 setup.py install

搞定,下面是安装成功的消息:

相关推荐
FreeBuf_2 小时前
Coruna漏洞利用工具揭示Triangulation iOS攻击框架的演进
macos·ios·cocoa
EasyControl移动设备管理2 小时前
打破系统壁垒:从 Android 到 macOS,打造全平台统一终端管理(MDM)方案
android·人工智能·物联网·macos·移动设备管理·mdm系统·跨区域设备
IT大师兄吖3 小时前
faster-whisper 音频转字幕 懒人整合包
ide·macos·xcode
bearpping3 小时前
MacOs安装Redis并设置为开机、后台启动
redis·macos·蓝桥杯
ZzT17 小时前
给 Claude Code 装一只状态栏桌宠:cc-statistics 新版本更新
macos·开源·claude
YoungHong19921 天前
Claude Code & 智谱GLM-5.1 环境配置指南 (Windows/macOS/Ubuntu)
windows·ubuntu·macos
全栈攻略1 天前
老版本Docker Desktop for Mac 历史版本下载大全(macOS 10.15/11/12)
macos·docker·容器
YoungHong19921 天前
【图文】Codex接入Kimi K2/GLM-5.1 环境配置指南 (Windows/macOS/Ubuntu)
windows·ubuntu·macos
leluckys1 天前
Jenkins CI/CD 持续集成专题九 -Mac服务器上配置Jenkins实现iOS项目自动打包
macos·ci/cd·jenkins