OS X version: 10.14.2
python version: 3.6.2
dlib version: 19.17.0
boost version: boost: stable 1.68.0 (bottled), HEAD
boost-python3: stable 1.68.0 (bottled), HEAD
GCC 4.2.1 Compatible Apple LLVM 9.1.0 (clang-902.0.39.2)
I install dlib by:
and i make virtualenv.
pip install dlib.
intsall successfully.
But when i run
import dlib
get this:
File "<stdin>", line 1, in <module>
ImportError: dlopen(/usr/local/lib/python3.6/site-packages/dlib.cpython-36m-darwin.so, 2): Symbol not found: _png_set_longjmp_fn
Referenced from: /usr/local/lib/python3.6/site-packages/dlib.cpython-36m-darwin.so
Expected in: flat namespace
in /usr/local/lib/python3.6/site-packages/dlib.cpython-36m-darwin.so
can you tell me how to deal this problem?
By the way, my brew gcc is /usr/local/Cellar/gcc/8.3.0.
I don't know whether this affect .
Uninstall libpng. Brew probably installed a broken copy of it. Then reinstall dlib.
i tried, i run brew reinstall libpng for several times.
And my libpng version is libpng: stable 1.6.36 (bottled), HEAD.
And i run ln -s /usr/local/Cellar/libpng/1.6.36/lib/libpng16.16.dylib /usr/local/lib/libpng16.16.dylib
But it still doesn't work..
Don鈥檛 reinstall. Delete
I tried, i run:
rm -r /usr/local/Cellar/libpng/rm /Users/fjl2401/Library/Caches/Homebrew/downloads/b401f5b07a537975da7de448c4bbdaf0c2112d5dc7d8e0955e0d4fb938909010--libpng-1.6.36.mojave.bottle.tar.gzbrew uninstall --ignore-dependencies libpngbrew reinstall dlibpip3 uninstall dlibpip3 install dlibNo. Do not install libpng from brew. Entirety remove it. Don鈥檛 reinstall. Make your computer not have libpng on it.
yeah...I rm libpng, but when i use brew to reinstall dlib. It will install libpng as dependency automatically.
I rm libpng, and pip reinstall dlib. It shows the same error:
>>> import dlib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: dlopen(/usr/local/lib/python3.6/site-packages/dlib.cpython-36m-darwin.so, 2):
Symbol not found: _png_set_longjmp_fn
Referenced from: /usr/local/lib/python3.6/site-packages/dlib.cpython-36m-darwin.so
Expected in: flat namespace
in /usr/local/lib/python3.6/site-packages/dlib.cpython-36m-darwin.so
Does it mean i haven't rm libpng on my computer totally? Now my brew have dlib, don't have libpng.
My python3 have dlib.
Don鈥檛 brew install anything, especially dlib. Brew is broken. Pip install dlib after removing libpng.
Thank you very much ! i rm all lib about libpng on my computer. And i run import dlib in python.
And it shows can't find libpng.lib from php5...
So... i think i find the reason. I rm all libpng in /usr/local/lib and rm -rf /usr/local/php5-5.6.31-20170817-164511 and pip install dlib --no-cache .After setup.py build a long time. It works well ! Thank you very much.
I also just pushed a change to github that will cause cmake to build a little test program to see if the system copy of libpng actually works. If it doesn't it will automatically do the right thing now.
Also just added checks like this for libjpeg. Hopefully this fixes this kind of issue forever. The previous checks were less robust. Can you try installing the latest dlib from github? It should work, even if you brew install libpng first.
i installed use pip: pip install git+https://github.com/davisking/dlib.git and Successfully installed dlib-19.17.99. And i run my script, it works well.
Sweet, thanks for testing it.
Most helpful comment
I also just pushed a change to github that will cause cmake to build a little test program to see if the system copy of libpng actually works. If it doesn't it will automatically do the right thing now.