linux环境下安装pyexr的历程

项目需要用到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/chensiyu/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/chensiyu/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/chensiyu/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

尝试二:下载库文件

先在https://www.lfd.uci.edu/~gohlke/pythonlibs/下载对应的OpenEXR库文件,

再pip install  xxx.whl 安装OpenEXR。

依然报错。。。

尝试三:github 安装依赖库

详细过程见: https://github.com/tvogels/pyexr

依然安装失败

尝试四:

conda install openexr-python    #先安装openexr
pip install pyexr

 大功告成!yeah!

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值