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

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

相关推荐
大熊猫侯佩15 小时前
升级到 macOS26.5 后看视频会自动息屏的解决
macos·操作系统
磊 子17 小时前
C++ IO 流
macos·objective-c·cocoa
real_haha17 小时前
我做了一个仅有 1.3 MB 的 macOS 原生 AI 助手:AskNow
人工智能·macos
June bug1 天前
(Mac)macOS x86_64上onnxruntime==1.24.4 安装失败
macos
ACP广源盛139246256731 天前
iOS 27 开放 AI 生态@ACP#小型化扩展黄金风口,IX8008全面超越 ASM2806,铸就嵌入式 AI 扩展核心
人工智能·嵌入式硬件·macos·ios·计算机外设·objective-c·cocoa
海的辽阔1 天前
如何在MAC下安装EcomGpt模型
macos·大模型·ecomgpt
zandy10111 天前
hermes agent 安装教程 3.0:Win / Mac / Linux 全平台指南
linux·运维·macos
花开·莫之弃1 天前
Mac安装多版本jdk(jenv)
java·开发语言·macos
June bug2 天前
(Mac)torch==2.1.2 与 Python 3.12 不兼容+onnxruntime-silicon 不支持 Intel Mac
开发语言·python·macos
码农小北2 天前
MAC 配置鸿蒙(HarmonyOS) SDK 环境变量完整指南
macos·华为·harmonyos