gpt4 book ai didi

python - 为Python安装OpenEXR失败

转载 作者:行者123 更新时间:2023-12-03 16:13:09 25 4
gpt4 key购买 nike

我正在尝试安装OpenEXR。

使用 :

MacOS 10.14.5

的Python 3.6.5

Xcode版本10.2.1

我试过了

pip install openexr

但出现以下错误:
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-0_bh3qoe/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-gq2luicr --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-0_bh3qoe/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-82it1du_/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-0_bh3qoe/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-82it1du_/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/g9/k_xb1tyd5hbg_48np5hvwh3m0000gn/T/pip-install-0_bh3qoe/openexr/

如果我尝试安装其他软件包,例如:

https://github.com/jamesbowman/openexrpython

或者
pip install pyexr

然后我尝试了:
brew install openexr

并且它安装没有错误。但是在python中导入时找不到我。

有谁知道为什么以及如何解决这个问题?

大多数安装指南建议通过pip安装,但出现上述错误。问题似乎是找不到stdlibc++?

最佳答案

对我来说,它首先通过brew安装OpenEXR,然后直接通过git安装

brew install openexr
pip install git+https://github.com/jamesbowman/openexrpython.git

关于python - 为Python安装OpenEXR失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57061350/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com