Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenEXR.cpp:36:10: fatal error: 'ImathBox.h' file not found #449

Closed
SilvioJin opened this issue Jul 17, 2019 · 3 comments
Closed

OpenEXR.cpp:36:10: fatal error: 'ImathBox.h' file not found #449

SilvioJin opened this issue Jul 17, 2019 · 3 comments

Comments

@SilvioJin
Copy link

SilvioJin commented Jul 17, 2019

I'm trying to install openexr for python, so I first started with installing and building this repo (following the instructions as mentioned in here, I downloaded the repo and followed the TLDR part) and it installs and builds correctly (although I had to do
brew uninstall boost-python).

Then I did
pip install openexr

and this was the error:

Collecting openexr
  Using cached https://files.pythonhosted.org/packages/7c/c4/76bf884f59d3137847edf8b93aaf40f6257d8315d0064e8b1a606ad80b1b/OpenEXR-1.3.2.tar.gz
Building wheels for collected packages: openexr
  Building wheel for openexr (setup.py) ... error
  ERROR: Complete output from command /Users/silviojin/anaconda3/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/g9/k_xb1tyd5hbg_48np5hvwh3m0000gn/T/pip-install-62j670go/openexr/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/g9/k_xb1tyd5hbg_48np5hvwh3m0000gn/T/pip-wheel-y7k6_it0 --python-tag cp36:
  ERROR: running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.7-x86_64-3.6
  copying Imath.py -> build/lib.macosx-10.7-x86_64-3.6
  running build_ext
  building 'OpenEXR' extension
  creating build/temp.macosx-10.7-x86_64-3.6
  gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/silviojin/anaconda3/include -arch x86_64 -I/Users/silviojin/anaconda3/include -arch x86_64 -I/usr/include/OpenEXR -I/usr/local/include/OpenEXR -I/opt/local/include/OpenEXR -I/Users/silviojin/anaconda3/include/python3.6m -c OpenEXR.cpp -o build/temp.macosx-10.7-x86_64-3.6/OpenEXR.o -g -DVERSION="1.3.2"
  warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
  In file included from OpenEXR.cpp:36:
  In file included from /usr/local/include/OpenEXR/ImathBox.h:65:
  In file included from /usr/local/include/OpenEXR/ImathVec.h:46:
  In file included from /usr/local/include/OpenEXR/ImathExc.h:47:
  /usr/local/include/OpenEXR/IexBaseExc.h:49:10: fatal error: 'string' file not found
  #include <string>
           ^~~~~~~~
  1 warning and 1 error generated.
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for openexr
  Running setup.py clean for openexr
Failed to build openexr
Installing collected packages: openexr
  Running setup.py install for openexr ... error
    ERROR: Complete output from command /Users/silviojin/anaconda3/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/g9/k_xb1tyd5hbg_48np5hvwh3m0000gn/T/pip-install-62j670go/openexr/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/g9/k_xb1tyd5hbg_48np5hvwh3m0000gn/T/pip-record-jpxqo66g/install-record.txt --single-version-externally-managed --compile:
    ERROR: running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.7-x86_64-3.6
    copying Imath.py -> build/lib.macosx-10.7-x86_64-3.6
    running build_ext
    building 'OpenEXR' extension
    creating build/temp.macosx-10.7-x86_64-3.6
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/silviojin/anaconda3/include -arch x86_64 -I/Users/silviojin/anaconda3/include -arch x86_64 -I/usr/include/OpenEXR -I/usr/local/include/OpenEXR -I/opt/local/include/OpenEXR -I/Users/silviojin/anaconda3/include/python3.6m -c OpenEXR.cpp -o build/temp.macosx-10.7-x86_64-3.6/OpenEXR.o -g -DVERSION="1.3.2"
    warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
    In file included from OpenEXR.cpp:36:
    In file included from /usr/local/include/OpenEXR/ImathBox.h:65:
    In file included from /usr/local/include/OpenEXR/ImathVec.h:46:
    In file included from /usr/local/include/OpenEXR/ImathExc.h:47:
    /usr/local/include/OpenEXR/IexBaseExc.h:49:10: fatal error: 'string' file not found
    #include <string>
             ^~~~~~~~
    1 warning and 1 error generated.
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command "/Users/silviojin/anaconda3/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/g9/k_xb1tyd5hbg_48np5hvwh3m0000gn/T/pip-install-62j670go/openexr/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/g9/k_xb1tyd5hbg_48np5hvwh3m0000gn/T/pip-record-jpxqo66g/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/g9/k_xb1tyd5hbg_48np5hvwh3m0000gn/T/pip-install-62j670go/openexr/

So I went into /usr/local/include and I noticed that OpenEXR was the only directory that was physically there and not symbolically linked to a directory in /usr/local/Cellar.

Why is that?

Then just to try, I moved the OpenEXR directory (that contains the .h files like ImathBox.h) from /usr/local/include to /usr/local/Cellar and created a link in /usr/local/include.

Then I tried again

pip install openexr

and the result was slightly different:

Collecting openexr
  Using cached https://files.pythonhosted.org/packages/7c/c4/76bf884f59d3137847edf8b93aaf40f6257d8315d0064e8b1a606ad80b1b/OpenEXR-1.3.2.tar.gz
Building wheels for collected packages: openexr
  Building wheel for openexr (setup.py) ... error
  ERROR: Complete output from command /Users/silviojin/anaconda3/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/g9/k_xb1tyd5hbg_48np5hvwh3m0000gn/T/pip-install-ar599j7u/openexr/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /private/var/folders/g9/k_xb1tyd5hbg_48np5hvwh3m0000gn/T/pip-wheel-tr6xiwvw --python-tag cp36:
  ERROR: running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-10.7-x86_64-3.6
  copying Imath.py -> build/lib.macosx-10.7-x86_64-3.6
  running build_ext
  building 'OpenEXR' extension
  creating build/temp.macosx-10.7-x86_64-3.6
  gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/silviojin/anaconda3/include -arch x86_64 -I/Users/silviojin/anaconda3/include -arch x86_64 -I/usr/include/OpenEXR -I/usr/local/include/OpenEXR -I/opt/local/include/OpenEXR -I/Users/silviojin/anaconda3/include/python3.6m -c OpenEXR.cpp -o build/temp.macosx-10.7-x86_64-3.6/OpenEXR.o -g -DVERSION="1.3.2"
  warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
  OpenEXR.cpp:36:10: fatal error: 'ImathBox.h' file not found
  #include <ImathBox.h>
           ^~~~~~~~~~~~
  1 warning and 1 error generated.
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for openexr
  Running setup.py clean for openexr
Failed to build openexr
Installing collected packages: openexr
  Running setup.py install for openexr ... error
    ERROR: Complete output from command /Users/silviojin/anaconda3/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/g9/k_xb1tyd5hbg_48np5hvwh3m0000gn/T/pip-install-ar599j7u/openexr/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/g9/k_xb1tyd5hbg_48np5hvwh3m0000gn/T/pip-record-sfr18ojx/install-record.txt --single-version-externally-managed --compile:
    ERROR: running install
    running build
    running build_py
    creating build
    creating build/lib.macosx-10.7-x86_64-3.6
    copying Imath.py -> build/lib.macosx-10.7-x86_64-3.6
    running build_ext
    building 'OpenEXR' extension
    creating build/temp.macosx-10.7-x86_64-3.6
    gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/silviojin/anaconda3/include -arch x86_64 -I/Users/silviojin/anaconda3/include -arch x86_64 -I/usr/include/OpenEXR -I/usr/local/include/OpenEXR -I/opt/local/include/OpenEXR -I/Users/silviojin/anaconda3/include/python3.6m -c OpenEXR.cpp -o build/temp.macosx-10.7-x86_64-3.6/OpenEXR.o -g -DVERSION="1.3.2"
    warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found]
    OpenEXR.cpp:36:10: fatal error: 'ImathBox.h' file not found
    #include <ImathBox.h>
             ^~~~~~~~~~~~
    1 warning and 1 error generated.
    error: command 'gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command "/Users/silviojin/anaconda3/bin/python -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/g9/k_xb1tyd5hbg_48np5hvwh3m0000gn/T/pip-install-ar599j7u/openexr/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/g9/k_xb1tyd5hbg_48np5hvwh3m0000gn/T/pip-record-sfr18ojx/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/g9/k_xb1tyd5hbg_48np5hvwh3m0000gn/T/pip-install-ar599j7u/openexr/

The ImathBox.h file is inside the OpenEXR directory though.

I found someone with a similar error here but the suggested solutions didn't work for me. When doing
$ easy_install -U openexr

it gives basically the same error:

Searching for openexr
Reading https://pypi.org/simple/openexr/
Downloading https://files.pythonhosted.org/packages/7c/c4/76bf884f59d3137847edf8b93aaf40f6257d8315d0064e8b1a606ad80b1b/OpenEXR-1.3.2.tar.gz#sha256=1ef52d60a2c2cd0ebf8d8a7baf7fffd2a475953035dd9afab2117b86526f339f
Best match: OpenEXR 1.3.2
Processing OpenEXR-1.3.2.tar.gz
Writing /var/folders/g9/k_xb1tyd5hbg_48np5hvwh3m0000gn/T/easy_install-rcf2ele7/OpenEXR-1.3.2/setup.cfg
Running OpenEXR-1.3.2/setup.py -q bdist_egg --dist-dir /var/folders/g9/k_xb1tyd5hbg_48np5hvwh3m0000gn/T/easy_install-rcf2ele7/OpenEXR-1.3.2/egg-dist-tmp-x8etbol4
warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++
      standard library instead [-Wstdlibcxx-not-found]
OpenEXR.cpp:36:10: fatal error: 'ImathBox.h' file not found
#include <ImathBox.h>
         ^~~~~~~~~~~~
1 warning and 1 error generated.

Can anyone help?

I'm using:
MacOS 10.14.5
Python 3.6.5

@meshula
Copy link
Contributor

meshula commented Jul 17, 2019

Hi there! The openexr python bindings weren't created, and aren't maintained by the OpenEXR team. The project is hosted here - https://github.com/jamesbowman/openexrpython - others running into the issues you note have got assistance there. Closing for now, please reopen if there's something that needs attention here. Hope this helps!

@meshula meshula closed this as completed Jul 17, 2019
@rastilin
Copy link

I think you're missing the "libopenexr-dev" package if you're trying to build on a linux system.

@lexi-brt
Copy link

Encountered a similar issue with our build that was due to not having the correct version of libstdc++ installed for the compiler version being used.

Check which version compilers you have installed with:

sudo apt list --installed gcc*
sudo apt list --installed g++*
sudo apt list --installed libstdc++*

And if any are missing install it. For me, I was missiing 12:

sudo apt install libstdc++-12-dev

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants