首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何解决Ubuntu中的openexr安装错误?

如何解决Ubuntu中的openexr安装错误?
EN

Stack Overflow用户
提问于 2022-03-30 12:52:29
回答 1查看 412关注 0票数 1

我试图在ubuntu中安装 openexr ,并使用pip安装openexr。但这不是工作。另外,我试图使用.whl文件进行安装,但是返回了错误。

错误:OpenEXR-1.3.7-cp39-cp39-winamd64。

我该如何解决这个问题?

Python : 3.9.5

Ubuntu : 21.04

和平执行方案: 22.0.4

错误日志:

代码语言:javascript
复制
Collecting openexr
  Using cached OpenEXR-1.3.7.tar.gz (11 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: openexr
  Building wheel for openexr (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [13 lines of output]
      Looking for libOpenEXR...
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.9
      copying Imath.py -> build/lib.linux-x86_64-3.9
      running build_ext
      building 'OpenEXR' extension
      creating build/temp.linux-x86_64-3.9
      clang-9 -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/build/python3.9-FZ7wim/python3.9-3.9.5=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/include/OpenEXR -I/usr/local/include/OpenEXR -I/opt/local/include/OpenEXR -I/usr/include/Imath -I/usr/local/include/Imath -I/opt/local/include/Imath -I/home/donghyuk/repo/2022_pm_research/PC-Differentiable/venv/include -I/usr/include/python3.9 -c OpenEXR.cpp -o build/temp.linux-x86_64-3.9/OpenEXR.o -g -DVERSION=\"1.3.7\"
      clang: error: unknown argument: '-ffile-prefix-map=/build/python3.9-FZ7wim/python3.9-3.9.5=.'
      error: command '/usr/bin/clang-9' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  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: subprocess-exited-with-error
  
  × Running setup.py install for openexr did not run successfully.
  │ exit code: 1
  ╰─> [15 lines of output]
      Looking for libOpenEXR...
      running install
      /home/donghyuk/repo/2022_pm_research/PC-Differentiable/venv/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
        warnings.warn(
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.9
      copying Imath.py -> build/lib.linux-x86_64-3.9
      running build_ext
      building 'OpenEXR' extension
      creating build/temp.linux-x86_64-3.9
      clang-9 -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -ffile-prefix-map=/build/python3.9-FZ7wim/python3.9-3.9.5=. -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -fPIC -I/usr/include/OpenEXR -I/usr/local/include/OpenEXR -I/opt/local/include/OpenEXR -I/usr/include/Imath -I/usr/local/include/Imath -I/opt/local/include/Imath -I/home/donghyuk/repo/2022_pm_research/PC-Differentiable/venv/include -I/usr/include/python3.9 -c OpenEXR.cpp -o build/temp.linux-x86_64-3.9/OpenEXR.o -g -DVERSION=\"1.3.7\"
      clang: error: unknown argument: '-ffile-prefix-map=/build/python3.9-FZ7wim/python3.9-3.9.5=.'
      error: command '/usr/bin/clang-9' failed with exit code 1
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> openexr

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
EN

回答 1

Stack Overflow用户

发布于 2022-03-30 14:12:26

此处编译中使用的选项ffile-prefix-map仅在clang中可用,从版本10开始,请参见这里。您似乎拥有clang-9,所以只需获得一个更新的版本:

代码语言:javascript
复制
sudo apt install clang-11

附加注意:您的whl是用于windows的,标记为win_amd64 whcih是它不安装到您的ubuntu系统的原因。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71677597

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档