Discussion:
[Maya-Python] MayaPy Cython Error
x***@gmail.com
2018-01-23 03:16:42 UTC
Permalink
Hi Everyone!
I got a issue which beset me in the past few days about how to compiling pyd file using mayapy.exe.

I have tested on Windows10 with both maya2014 and maya2016 sp6, but got the same error like bellow:

"Runtime Error!
Program: C:\Program Files\Autodesk\Maya2014\bin\mayapy.exe

R6034
An application has made an attempt to load the C runtime library incorrectly.
Please contract the application's support team for more information."


E:\test\test>mayapy setup.py build_ext --inplace
Traceback (most recent call last):
File "setup.py", line 2, in <module>
from Cython.Build import cythonize
File "C:\Program Files\Autodesk\Maya2014\Python\lib\site-packages\Cython\Build\__init__.py", line 1, in <module>
from .Dependencies import cythonize
File "C:\Program Files\Autodesk\Maya2014\Python\lib\site-packages\Cython\Build\Dependencies.py", line 59, in <module>
from ..Compiler.Main import Context, CompilationOptions, default_options
File "C:\Program Files\Autodesk\Maya2014\Python\lib\site-packages\Cython\Compiler\Main.py", line 28, in <module>
from .Scanning import PyrexScanner, FileSourceDescriptor
ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.


--------------------------------------------------------------------

This is my simple hello world python script file:

def hello():
print "Hello World"

--------------------------------------------------------------------

This my setup.py file:

from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext

setup(
cmdclass = {'build_ext': build_ext},
ext_modules = [Extension("helloworld", ["helloworld.py"])]
)

----------------------------------------------------------------------

Btw, i used pip to install Cython under C:\Program Files\Autodesk\Maya2014\Python\Lib\site-packages.


Does anyone face the same issue like me and have any solution about it?
Anyone can help?
Great thanks for you!!
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/ece1c1e7-3729-4144-8a14-cbdab8d37368%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Justin Israel
2018-01-23 03:47:14 UTC
Permalink
My guess is that the compiled aspects of Cython don't like being loaded
into Maya's python. Do you need to build Cython against Maya specifically?
I use Cython-based projects inside of Maya, but my experience is on Linux.
Generally I can just use a standard Cython installation and build with a
generally compatible gcc version.

Justin
Post by x***@gmail.com
Hi Everyone!
I got a issue which beset me in the past few days about how to
compiling pyd file using mayapy.exe.
I have tested on Windows10 with both maya2014 and maya2016 sp6, but got
"Runtime Error!
Program: C:\Program Files\Autodesk\Maya2014\bin\mayapy.exe
R6034
An application has made an attempt to load the C runtime library incorrectly.
Please contract the application's support team for more information."
E:\test\test>mayapy setup.py build_ext --inplace
File "setup.py", line 2, in <module>
from Cython.Build import cythonize
File "C:\Program
Files\Autodesk\Maya2014\Python\lib\site-packages\Cython\Build\__init__.py",
line 1, in <module>
from .Dependencies import cythonize
File "C:\Program
Files\Autodesk\Maya2014\Python\lib\site-packages\Cython\Build\Dependencies.py",
line 59, in <module>
from ..Compiler.Main import Context, CompilationOptions,
default_options
File "C:\Program
Files\Autodesk\Maya2014\Python\lib\site-packages\Cython\Compiler\Main.py",
line 28, in <module>
from .Scanning import PyrexScanner, FileSourceDescriptor
ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.
--------------------------------------------------------------------
print "Hello World"
--------------------------------------------------------------------
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
setup(
cmdclass = {'build_ext': build_ext},
ext_modules = [Extension("helloworld", ["helloworld.py"])]
)
----------------------------------------------------------------------
Btw, i used pip to install Cython under C:\Program
Files\Autodesk\Maya2014\Python\Lib\site-packages.
Does anyone face the same issue like me and have any solution about it?
Anyone can help?
Great thanks for you!!
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/ece1c1e7-3729-4144-8a14-cbdab8d37368%40googlegroups.com
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0kKvkEg5qBUqrh7CELzoQpBsHyokdh7_RN%3DPmEVnk2LQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Robert White
2018-01-23 12:12:11 UTC
Permalink
You'd need to build Cython for maya against the proper version of visual
studio.
Which in 2014 I believe was VS2010. You'll also need to use that version
when actually compiling your cython project.
Post by Justin Israel
My guess is that the compiled aspects of Cython don't like being loaded
into Maya's python. Do you need to build Cython against Maya specifically?
I use Cython-based projects inside of Maya, but my experience is on Linux.
Generally I can just use a standard Cython installation and build with a
generally compatible gcc version.
Justin
Post by x***@gmail.com
Hi Everyone!
I got a issue which beset me in the past few days about how to
compiling pyd file using mayapy.exe.
I have tested on Windows10 with both maya2014 and maya2016 sp6, but got
"Runtime Error!
Program: C:\Program Files\Autodesk\Maya2014\bin\mayapy.exe
R6034
An application has made an attempt to load the C runtime library incorrectly.
Please contract the application's support team for more information."
E:\test\test>mayapy setup.py build_ext --inplace
File "setup.py", line 2, in <module>
from Cython.Build import cythonize
File "C:\Program
Files\Autodesk\Maya2014\Python\lib\site-packages\Cython\Build\__init__.py",
line 1, in <module>
from .Dependencies import cythonize
File "C:\Program
Files\Autodesk\Maya2014\Python\lib\site-packages\Cython\Build\Dependencies.py",
line 59, in <module>
from ..Compiler.Main import Context, CompilationOptions,
default_options
File "C:\Program
Files\Autodesk\Maya2014\Python\lib\site-packages\Cython\Compiler\Main.py",
line 28, in <module>
from .Scanning import PyrexScanner, FileSourceDescriptor
ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.
--------------------------------------------------------------------
print "Hello World"
--------------------------------------------------------------------
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
setup(
cmdclass = {'build_ext': build_ext},
ext_modules = [Extension("helloworld", ["helloworld.py"])]
)
----------------------------------------------------------------------
Btw, i used pip to install Cython under C:\Program
Files\Autodesk\Maya2014\Python\Lib\site-packages.
Does anyone face the same issue like me and have any solution about it?
Anyone can help?
Great thanks for you!!
--
You received this message because you are subscribed to the Google Groups
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/ece1c1e7-3729-4144-8a14-cbdab8d37368%40googlegroups.com
.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/b3c4c259-db8f-4d0d-9df1-45bd4cd263f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
x***@gmail.com
2018-02-05 02:50:14 UTC
Permalink
Thanks Justin Israel and Robert White, i will give a try..
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/4168ed15-fe6e-45c5-a7fa-c2fee28dafa1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
x***@gmail.com
2018-02-08 03:12:44 UTC
Permalink
Thanks very much to Justin Israel and Robert White, I had solved the issue already!!
Like you said, i had install visual studio 2012, and build Cython for maya2014 and maya2016. Both of them are working fine!! Great thanks!
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/b7bb05db-0436-4954-9fa9-71213c4400ff%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
l***@gmail.com
2018-08-29 09:35:27 UTC
Permalink
圚 2018幎2月8日星期四 UTC+8䞊午11:12:52埐宗巧写道
Post by x***@gmail.com
Thanks very much to Justin Israel and Robert White, I had solved the issue already!!
Like you said, i had install visual studio 2012, and build Cython for maya2014 and maya2016. Both of them are working fine!! Great thanks!
How did you solve it? Could you elaborate on that? I had the same problem
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/1a255bcd-7bd0-4375-ab82-e19decc10677%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Robert White
2018-09-02 18:21:09 UTC
Permalink
So you need to get the proper version of visual studio installed.
You'll also want to get pip installed with mayapy.
Then you want to use the command proper VS command prompt for that version.
You need to add the Python libs to LIB, and the headers to INCLUDE, these
should be located somewhere in the maya install directory.
At this point you can finally do `pip install cython --no-binary :all:`
which will for cython to install itself while building from source, and not
using any pre-compiled binaries, which is what you're attempting to avoid.
Post by l***@gmail.com
圚 2018幎2月8日星期四 UTC+8䞊午11:12:52埐宗巧写道
Post by x***@gmail.com
Thanks very much to Justin Israel and Robert White, I had solved the
issue already!!
Post by x***@gmail.com
Like you said, i had install visual studio 2012, and build Cython for
maya2014 and maya2016. Both of them are working fine!! Great thanks!
How did you solve it? Could you elaborate on that? I had the same problem
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/3eec750a-39a7-4c63-9a98-e41eacc3203f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...