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

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

相关推荐
Mike_detailing2 小时前
资源分享:VMware-Fusion-25H2u1 和 arm版本win11
macos·arm·虚拟机
承渊政道3 小时前
【递归、搜索与回溯算法】(掌握记忆化搜索的核心套路)
数据结构·c++·算法·leetcode·macos·动态规划·宽度优先
REDcker3 小时前
跨平台编译详解 工具链配置与工程化实践
linux·c++·windows·macos·c·跨平台·编译
白豆五3 小时前
Mac平台安装Claude Code
macos
寂夜了无痕3 小时前
macOS 下 `ls: .: Operation not permitted
macos
库奇噜啦呼17 小时前
【iOS】内存对齐原理
macos·ios·cocoa
子沫202018 小时前
mac下载VMware Fusion
macos·mac·vmware fusion
xwz_new21 小时前
数字芯片验证工具之Mac安装Icarus Verily+ GTKWave+VScode(免费)
macos·ic验证
卵男(章鱼)1 天前
系统终端命令对比大全(Linux发行/macOS/Windows)
linux·运维·服务器·windows·macos
SNOWPIAOP1 天前
从MAC电脑复制qwen3.5:4b 的OLLAMA模型到LINUX电脑实践
linux·运维·macos·manifest·ollama·blobs