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

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

相关推荐
星辰即远方11 小时前
天气预报总结
macos·ios·objective-c·cocoa
xixiaoyunya12 小时前
Mac远程访问新范式:基于80KM穿云箭的内网穿透技术实践
macos
秋雨梧桐叶落莳13 小时前
计算器仿写总结
学习·macos·ios·objective-c·cocoa
寒水馨1 天前
macOS下载、安装uv-0.12.0(附安装包uv-aarch64-apple-darwin.tar.gz)
python·macos·rust·项目管理·包管理器·astral·pip替代
寒水馨1 天前
macOS下载、安装protobuf-v35.1(附安装包protoc-35.1-osx-universal_binary.zip)
macos·google·grpc·序列化·protobuf·protoc·数据交换
寒水馨1 天前
macOS下载、安装ripgrep-15.2.0(附安装包ripgrep-15.2.0-aarch64-apple-darwin.tar.gz)
macos·正则表达式·rust·ripgrep·rg·命令行搜索·代码搜索
起司喵喵2 天前
Flutter-MacOS桌面OS系统|flutter.+window_manager客户端OS模板
flutter·macos·策略模式
代码对我眨眼睛2 天前
macOS Google Chrome 常用快捷键
前端·chrome·macos
啊真真真2 天前
macOS下libnfc ..写卡失败问题及解决方案
macos·策略模式
叶 落2 天前
Mac 通过 Miniconda 安装 Python
python·macos·conda·miniconda