Apple M1 Max '/usr/lib/libpng16.16.dylib' (no such file)
Version of Dear PyGui
Version: 1.6.2 Operating System: Mac OS Monterey 12.4 (M1 Max)
My Issue/Question
Getting the following Import Error when trying to run my application:
Reason: tried: '/usr/local/opt/libpng/lib/libpng16.16.dylib' (no such file), '/usr/lib/libpng16.16.dylib' (no such file)
Fresh install on a completely new computer. Tried using python 3.7 to 3.9 with the same results.
What iv tried
-
brew install libpng
Warning: libpng 1.6.37 is already installed and up-to-date.
To reinstall 1.6.37, run:
brew reinstall libpng
- rebooted and retired with the same result
To Reproduce
- run a basic dearpygui example on M1 mbp
Steps to reproduce the behavior:
- Copy the code below into a python file on an M1 mac
- Run the code
Standalone, minimal, complete and verifiable example
import dearpygui.dearpygui as dpg
def save_callback():
print("Save Clicked")
dpg.create_context()
dpg.create_viewport()
dpg.setup_dearpygui()
with dpg.window(label="Example Window"):
dpg.add_text("Hello world")
dpg.add_button(label="Save", callback=save_callback)
dpg.add_input_text(label="string")
dpg.add_slider_float(label="float")
dpg.show_viewport()
dpg.start_dearpygui()
dpg.destroy_context()
Any ideas on what could be the issue would be much appreciated, thanks!
Noticed one thing, seems homebrew is not placing symlinks under /usr/local/opt for some reason.
homebrew install seems to be fixed, iv also copied the library (libpng16.16.dylib) to the specified location to see if that helps, but now it seems its detecting the wrong architecture.
Fixed this by installing Homebrew in different location (for x86_64 package installs), temporarily setting it in my path, and installing the x86_64 version of libpng, then copying it to the expected location:
sudo mkdir -p /usr/local/opt
sudo chown $USER /usr/local/opt
cd /usr/local/opt
git clone https://github.com/Homebrew/brew
export PATH=/usr/local/opt/brew/bin:$PATH
arch -x86_64 brew reinstall libpng
sudo cp /usr/local/opt/brew/Cellar/libpng/1.6.37/lib/libpng16.16.dylib /usr/local/opt/libpng/lib/.
This appears to be a general issue for MacOS and not just M1. I see this issue on Intel systems as well. Appears to be duplicate of #1397.
This should be fixed!