libgdiplus在MacOS M1上问题:Unable to load shared library ‘libgdiplus‘

libgdiplus在MacOS M1上问题:Unable to load shared library 'libgdiplus'

问题

在mac上的pycharm中执行下面的代码时出现下面的错误

slide.get_thumbnail(

RuntimeError: Proxy error(TypeInitializationException): The type initializer for 'Gdip' threw an exception. ---> DllNotFoundException: Unable to load shared library 'libgdiplus' or one of its dependencies. In order to help diagnose loading problems, consider setting the DYLD_PRINT_LIBRARIES environment variable: dlopen(liblibgdiplus, 0x0001): tried: 'liblibgdiplus' (no such file), '/System/Volumes/Preboot/Cryptexes/OSliblibgdiplus' (no such file), '/opt/anaconda3/envs/deepdoc-only/bin/.../lib/liblibgdiplus' (no such file), '/usr/lib/liblibgdiplus' (no such file, not in dyld cache), 'liblibgdiplus' (no such file), '/usr/local/lib/liblibgdiplus' (no such file), '/usr/lib/liblibgdiplus' (no such file, not in dyld cache)

解决

步骤1

https://docs.aspose.com/cells/zh/net/how-to-install-libgdiplus-in-macos/

按照提示安装

复制代码
brew install mono-libgdiplus

在MasOS M1上安装完,安装目录是/opt/homebrew/Cellar/mono-libgdiplus/6.1_2/lib,此时在pycharm中运行仍旧是不起作用。

步骤2

在pycharm中修改run configuration,新增一个环境变量environment variables

复制代码
DYLD_FALLBACK_LIBRARY_PATH=/opt/homebrew/Cellar/mono-libgdiplus/6.1_2/lib

之后在PyCharm中run代码的时候就可以正常使用了。

相关推荐
清水白石0081 小时前
NumPy 向量化实战指南:从原理到实践的性能革命
python·numpy
Coding茶水间1 小时前
基于深度学习的猪识别系统演示与介绍(YOLOv12/v11/v8/v5模型+Pyqt5界面+训练代码+数据集)
图像处理·人工智能·python·深度学习·yolo·目标检测
X54先生(人文科技)2 小时前
启蒙灯塔起源团预言—碳硅智能时代到来
人工智能·python·机器学习·语言模型
qq_24218863322 小时前
快速搭建跨环境检测服务的步骤
linux·开发语言·windows·python·macos
JaydenAI2 小时前
[拆解LangChain执行引擎]三种持久化模式的差异
python·langchain
老赵全栈实战2 小时前
《从零搭建RAG系统第4天:问题向量化+Milvus检索匹配+结果优化》
python·ai编程
Katecat996632 小时前
【葡萄病害检测】基于SABL-RetinaNet的葡萄叶片黑腐病、霜霉病、白粉病和锈病自动识别系统
python
FL16238631292 小时前
windows从源码安装python版本paddleocr3.4.0
开发语言·windows·python
七夜zippoe2 小时前
模型解释性实战:从黑盒到白盒的SHAP与LIME完全指南
人工智能·python·机器学习·shap·lime
Smart-Space3 小时前
QuickUp v4 新功能一览
python·tkinter·tinui