Open SebastianGrans opened 4 years ago
Hi @SebastianGrans! I'm having the exact problem as you do. Have you solved the problem yet? Any chance that you could offer some tips? Thank you!
@SarahChane98: I didn't solve it, but I discovered that OpenCV can import EXR files as well.
You can install it via pip
as the package opencv-python
.
import cv2
im = cv2.imread('path/file.exr')
Thank you so much! Just wondering, will Opencv output the same format as OpenEXR?
Somehow I ended up coming back to needing this package. I'm not exactly sure what's going on, but it has something to do with which C++ standard is used when compiling OpenEXR. Specifically we need to specify that C++11 should be used.
Installing OpenEXR on Linux works great but doesn't work on Mac. So it probably has something to do with Clang vs GCC. The solution is rather simple.
pip download openexr
(This downloads e.g. OpenEXR-1.3.2.tar.gz) tar -xzvf OpenEXR-1.3.2.tar.gz
OpenEXR-1.3.2/
. Inside that folder is setup.py
which we need to modify. extra_compile_args
so that it looks like this: extra_compile_args=['-g', '-DVERSION="%s"' % version, '-std=c++11'])
(Notice that we have added the flag for the C++11 standard).pip install .
I'm not sure if this would have any consequences on other platforms, but maybe @jamesbowman could look into it?
When I try to install OpenEXR via pip I get the error shown below. Any recommendations on how to resolve this?
Edit: I forgot to mention:
With
zlib
andopenexr
installed via brew: