mayapy segfault

131 views
Skip to first unread message

Fredrik Averpil

unread,
Apr 13, 2016, 3:33:36 AM4/13/16
to python_in...@googlegroups.com

Hi,

Has anyone successfully been able to run maya standalone from an external interpreter?

I’m talking about following this from the official docs.

When I run the following (python ext_mayapy.py), I’m getting “Segmentation fault (core dumped)”:


import os
import sys

MAYA_LOCATION = '/192.168.0.226/pipeline/bin/maya/builds/maya_v2016-ext1sp5_linux64'
MAYA_BIN_PATH =  os.path.join(MAYA_LOCATION, 'bin')
MAYA_SITE_PACKAGES = os.path.join(MAYA_LOCATION, 'lib', 'python2.7', 'site-packages')

# Change working directory
os.chdir(MAYA_BIN_PATH)

os.environ['MAYA_LOCATION'] = MAYA_LOCATION
os.environ['LD_LIBRARY_PATH'] = os.path.join(MAYA_LOCATION, 'lib')
os.environ['PATH'] = os.environ['PATH'] + os.pathsep + MAYA_BIN_PATH
sys.path.append(MAYA_SITE_PACKAGES)

import maya.standalone
maya.standalone.initialize(name='python')

The machine which is running the python script above is a CentOS 7 machine with Python 2.7.5 64-bit.

When I attempt to run mayapy directly, it works as I get this:

[iruser@blade1 bin]$ pwd
/111.222.333.444/pipeline/bin/maya/builds/maya_v2016-ext1sp5_linux64/bin

[iruser@blade1 bin]$ ./mayapy
./..
Python 2.7.6 (default, May  5 2014, 22:44:41)
[GCC 4.1.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import maya.standalone
>>> maya.standalone.initialize(name='python')
>>>

Regards,
Fredrik

Justin Israel

unread,
Apr 13, 2016, 6:18:22 AM4/13/16
to python_in...@googlegroups.com

Hey Fredrik

These environment variables have to be set before the python process is launched. So your shell or a bootstrap would have to configure the ld_library_path and then exec Maya/python

Justin


--
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_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAD%3DwhWO56wxdOdhq_B_9L_XCGu3WrdBLosn0fzn7OkusaKN5Og%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Fredrik Averpil

unread,
Apr 13, 2016, 8:37:16 AM4/13/16
to python_in...@googlegroups.com

Hi Justin,

These environment variables have to be set before the python process is launched

Ah. Dang. Of course…
Okay, back to the drawing table on that one. :)

Cheers!

Reply all
Reply to author
Forward
0 new messages