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

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

相关推荐
码农阿豪12 小时前
【金仓数据库征文】Mac开发环境|SpringBoot3 + MyBatisPlus对接KES V9 Docker实战全指南
数据库·macos·docker
赶路人儿1 天前
MacOS 下实现 AI 操控电脑(Computer Use)的思考
人工智能·macos·策略模式
天空'之城1 天前
VMware17.5.0安装macOS13.7.8|Xcode15.0.1+Qt6.5.3开发环境搭建完整教程
macos·虚拟机·vmware tools
00后程序员张1 天前
使用Instruments工具深入分析iOS应用性能与启动时间优化
android·macos·ios·小程序·uni-app·cocoa·iphone
2601_960906721 天前
AI研发加速中式及泛亚洲
人工智能·vscode·macos·sublime text·phpstorm
sg_knight1 天前
Codex CLI 安装全攻略:macOS / Linux / Windows(WSL2)三端实战
linux·windows·macos·openai·ai编程·coding·codex
Teleger2 天前
蓝牙 MAC 扫描匹配器
macos
刘婉晴2 天前
【漏扫工具篇】Mac 系统上 Xray 的安装与使用
macos
寒水馨3 天前
macOS下载、安装PowerShell-v7.6.4(附安装包powershell-7.6.4-osx-arm64.pkg)
macos·自动化·跨平台·shell·脚本·命令行·powershell
星辰即远方4 天前
天气预报总结
macos·ios·objective-c·cocoa