[Pymel]How to import OpenEXR module in maya script editor

Hi~
I am trying to write a texture format as EXR file(it can only accept EXR file) and finding maya script editor cannot load openEXR module.

What I do is just
import OpenEXR

and then I got error like this
// Error: ImportError: file <maya console> line 1: No module named OpenEXR //

I know I need to build it or install some module but I cannot find a way to do so. I googled it and those are for only work in Python but not for pymel use in Maya.
Is there any way to do with this situation?
I can import OpenEXR with my python 2.7 idel, but not in Maya script editor

Lots appreciate!!!

You need to compile OpenEXR python module with VC2010. Maya uses MSVCR100 runtime for its py modules, while original Python compiled with MSVCR90. Sometimes mayapy can handle native python DLL, but not in this case.

If you’re using Maya 2015 or 2016, you’ll actually need to compile against VC2012. 2013 and 2014 used VC2010.

Thanks Styler and R.White…
I am working on Maya 2016 and I think I probably need to build it with VC2012, but how to do it? I find there are lots of thread about “how to compile openexr with VC2010 for windows” but not for build it for python in Maya.

Big thanks again

This post helped me the other day:

I had to look up accessing solution properties and setting a release to build, but other than that it was simple.

Thanks Capper
I will look into it and try once I finish this project…

I still cannot make OpenEXR work in my maya script, so I am going to get my data inside Maya and write it with python IDLE. Hope it works HAHA
After finish this, maybe I will have more time to get it work>"<

Thanks again

I compiled it for Maya 2015+

1 Like

Big Thanks!!! Styler!!!
It works for me!!!

Thank you so much~~:D: