ModulenotFoundError:No模块名为' OpenExr'在搅拌机上

发布于 2025-01-31 23:51:38 字数 4378 浏览 1 评论 0原文

我正在尝试在Blender的3.1.2脚本上使用OpenExr模块,但我无法导入。我可以使用安装的Python 3.8.10导入它。

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

pip install openexr

pip3 install openexr

sudo apt install libopenexr-dev

它在我的Python 3.8.10命令行上正常工作。

然后,我尝试使用Blender的Python版本安装它:

./python3.10 -m pip install openexr

但是我从gcc

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.

解决该问题的任何方法中都会 收到该错误自己的版本?

我在Ubuntu 20.04

I'm trying to use OpenEXR module on blender's 3.1.2 script but I can't import it. I can import it using my python 3.8.10 installed.

I first install it using :

pip install openexr

pip3 install openexr

sudo apt install libopenexr-dev

And it works fine on my python 3.8.10 command line.

I then tried to install it using the blender's python version :

./python3.10 -m pip install openexr

but I get that error from gcc :

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.

Any way to solve that issue so I can use OpenEXR on blender or make blender to use python installed instead of it's own version ?

I'm on ubuntu 20.04

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

凉月流沐 2025-02-07 23:51:38

我终于通过将文件从OpenExr-1.3.8复制到Python可执行文件的文件夹,然后安装OpenExr来使其工作。

1-下载OpenEXR-1.3.8来自在这里

2-将所有文件复制到您的Blender Python可执行文件中,对我来说是:
/homa/jros/downloads/blender-2.90.0.0.0-linux64/2.90/python/bin/bin

3-使用这些参数可执行可执行

./python3.7m -m setup.py install

它应该起作用。您可能还需要安装这些:

sudo apt install python3.10-dev
pip install openexr
pip3 install openexr
sudo apt install libopenexr-dev

I finally get it to work by copying the files from OpenEXR-1.3.8 into the folder of the python executable and then installing OpenEXR.

1- Download OpenEXR-1.3.8 from here.

2- Copy all the files into your blender python executable, for me it was :
/homa/jros/Downloads/blender-2.90.0-linux64/2.90/python/bin

3- Run the executable with those parameters -m setup.py install like so

./python3.7m -m setup.py install

and it should work. You might need to install those as well :

sudo apt install python3.10-dev
pip install openexr
pip3 install openexr
sudo apt install libopenexr-dev
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文