首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ModuleNotFoundError:搅拌机上没有名为“OpenEXR”的模块

ModuleNotFoundError:搅拌机上没有名为“OpenEXR”的模块
EN

Stack Overflow用户
提问于 2022-05-24 14:23:28
回答 1查看 217关注 0票数 0

我试图在OpenEXR脚本上使用blender's 3.1.2模块,但无法导入它。我可以使用我安装的python 3.8.10导入它。

我首先使用以下方法安装它:

代码语言:javascript
复制
pip install openexr

pip3 install openexr

sudo apt install libopenexr-dev

而且它在我的python 3.8.10命令行上运行得很好。

然后我尝试使用搅拌器的python版本来安装它:

代码语言:javascript
复制
./python3.10 -m pip install openexr

但是我从gcc那里得到了这个错误:

代码语言:javascript
复制
Defaulting to user installation because normal site-packages is not writeable
Collecting openexr
  Using cached OpenEXR-1.3.8.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
  ╰─> [16 lines of output]
      Looking for libOpenEXR...
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.10
      copying Imath.py -> build/lib.linux-x86_64-3.10
      running build_ext
      building 'OpenEXR' extension
      creating build/temp.linux-x86_64-3.10
      gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -I/home/sybren/buildbot-builder/linux_glibc217_x86_64_cmake/build_deps/deps/Release/sqlite/include -I/home/sybren/buildbot-builder/linux_glibc217_x86_64_cmake/build_deps/deps/Release/bzip2/include -I/home/sybren/buildbot-builder/linux_glibc217_x86_64_cmake/build_deps/deps/Release/lzma/include -I/home/sybren/buildbot-builder/linux_glibc217_x86_64_cmake/build_deps/deps/Release/zlib/include -fPIC -fPIC -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/snap/blender/2106/3.1/python/include/python3.10 -c OpenEXR.cpp -o build/temp.linux-x86_64-3.10/OpenEXR.o -g -DVERSION="1.3.8"
      OpenEXR.cpp:1:10: fatal error: Python.h: No such file or directory
          1 | #include <Python.h>
            |          ^~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/gcc' 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
  ╰─> [16 lines of output]
      Looking for libOpenEXR...
      running install
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.10
      copying Imath.py -> build/lib.linux-x86_64-3.10
      running build_ext
      building 'OpenEXR' extension
      creating build/temp.linux-x86_64-3.10
      gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -I/home/sybren/buildbot-builder/linux_glibc217_x86_64_cmake/build_deps/deps/Release/sqlite/include -I/home/sybren/buildbot-builder/linux_glibc217_x86_64_cmake/build_deps/deps/Release/bzip2/include -I/home/sybren/buildbot-builder/linux_glibc217_x86_64_cmake/build_deps/deps/Release/lzma/include -I/home/sybren/buildbot-builder/linux_glibc217_x86_64_cmake/build_deps/deps/Release/zlib/include -fPIC -fPIC -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/snap/blender/2106/3.1/python/include/python3.10 -c OpenEXR.cpp -o build/temp.linux-x86_64-3.10/OpenEXR.o -g -DVERSION="1.3.8"
      OpenEXR.cpp:1:10: fatal error: Python.h: No such file or directory
          1 | #include <Python.h>
            |          ^~~~~~~~~~
      compilation terminated.
      error: command '/usr/bin/gcc' 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.

有什么办法可以解决这个问题,这样我就可以在搅拌机上使用OpenEXR,或者让搅拌器使用安装的python来代替它自己的版本?

我上的是ubuntu 20.04

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-05-24 19:00:35

最后,我将OpenEXR-1.3.8中的文件复制到python可执行文件的文件夹中,然后安装OpenEXR。

1-从OpenEXR-1.3.8下载这里

2-将所有文件复制到您的搅拌器python可执行文件中,对我来说是:/homa/jros/Downloads/blender-2.90.0-linux64/2.90/python/bin

3-使用这些参数-m setup.py install运行可执行文件,如下

代码语言:javascript
复制
./python3.7m -m setup.py install

而且它应该能工作。您可能还需要安装这些设备:

代码语言:javascript
复制
sudo apt install python3.10-dev
pip install openexr
pip3 install openexr
sudo apt install libopenexr-dev
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72364623

复制
相关文章

相似问题

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