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代码的时候就可以正常使用了。

相关推荐
小白菜又菜1 天前
Leetcode 235. Lowest Common Ancestor of a Binary Search Tree
python·算法·leetcode
Omigeq1 天前
1.2.2 - 采样搜索算法(以RRT和RRT*为例) - Python运动规划库教程(Python Motion Planning)
开发语言·人工智能·python·机器人
凌云拓界1 天前
TypeWell全攻略(二):热力图渲染引擎,让键盘发光
前端·后端·python·计算机外设·交互·pyqt·数据可视化
小白菜又菜1 天前
Leetcode 234. Palindrome Linked List
python·算法·leetcode
恒云客1 天前
python uv debug launch.json
数据库·python·json
Katecat996631 天前
YOLO11-SEG-AFPN-P345改进采血装置检测与识别系统
python
q1234567890981 天前
FNN sin predict
开发语言·python
先做个垃圾出来………1 天前
Python字节串“b“前缀
开发语言·python
dreams_dream1 天前
什么是迭代器和生成器
python
悠闲蜗牛�1 天前
深入浅出Spring Boot 3.x:新特性全解析与实战指南
开发语言·python