【Errors】Linux安装pyexr

直接pip install pyexr报错如下:

Building wheels for collected packages: OpenEXR
  Building wheel for OpenEXR (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/liutong/anaconda3/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-27w0cp27/openexr_ea45721825e34560ad3038b2307617b2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-27w0cp27/openexr_ea45721825e34560ad3038b2307617b2/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 /tmp/pip-wheel-8utnk5sl
       cwd: /tmp/pip-install-27w0cp27/openexr_ea45721825e34560ad3038b2307617b2/
  Complete output (14 lines):
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.linux-x86_64-3.8
  copying Imath.py -> build/lib.linux-x86_64-3.8
  running build_ext
  building 'OpenEXR' extension
  creating build/temp.linux-x86_64-3.8
  gcc -pthread -B /home/liutong/anaconda3/compiler_compat -Wl,--sysroot=/ -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -I/usr/include/OpenEXR -I/usr/local/include/OpenEXR -I/opt/local/include/OpenEXR -I/home/liutong/anaconda3/include/python3.8 -c OpenEXR.cpp -o build/temp.linux-x86_64-3.8/OpenEXR.o -g -DVERSION="1.3.2"
  cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
  OpenEXR.cpp:36:22: fatal error: ImathBox.h: No such file or directory
  compilation terminated.
  error: command 'gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for OpenEXR
  Running setup.py clean for OpenEXR
Failed to build OpenEXR

然后去网上找了一下pyexr的安装方式,找到了这篇博客:linux环境下安装pyexr的历程
他的方法二是完全不可行的,因为那个链接里面的文件都是适合安装在Windows下的whl文件,但是我用他的方法四也是会失败。

后面我发现,直接follow pyexr的github就能成功:pyexr

sudo apt install libopenexr-dev # (ubuntu)
pip install git+https://github.com/jamesbowman/openexrpython.git (dependency) # or try `conda install -c conda-forge openexr-python`
pip install pyexr

在这里第二步我用的是conda install -c conda-forge openexr-python

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值