From: Greg Ercolano <erco@(email surpressed)>
Subject: Re: CentOS 6 Python error
   Date: Tue, 12 Mar 2013 20:38:57 -0400
Msg# 2305
View Complete Thread (19 articles) | All Threads
Last Next
	OK Dan, just tested with Maya 2013 + Scientific Linux 6.3
	and could replicate the error, and work around it.


	REPLICATION
	-----------
	Created /tmp/foo.py with the contents:

import os,sys
print >> sys.stderr, "Hello world."


	Opened a fresh install of Maya 2013, and in the Maya python editor ran:

import os
os.system("python /tmp/foo.py")

	..which gave the following error in the unix terminal
	that I invoked Maya from:

--- snip
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
'import site' failed; use -v for traceback
Traceback (most recent call last):
  File "/tmp/foo.py", line 1, in <module>
    import os,sys
ImportError: No module named os
--- snip

	ANALYSIS
	--------

	I noticed PYTHONPATH and LD_LIBRARY_PATH both set in a way that I thought
	would break the OS version of python.

	SOLUTION
	--------
	So I modified the above command to unset those two variables
	as part of the command being run:

os.system("unset PYTHONPATH; unset LD_LIBRARY_PATH; python /tmp/foo.py")

	..and that worked fine.. printed 'Hello world.' in the terminal,
	and returned '0' as the exit code.

	With that working, I was able to include those 'unset' commands
	to run the rush submit_maya.py python script as well and submit
	a job successfully:

os.system("unset PYTHONPATH; unset LD_LIBRARY_PATH; python /eagle/net/rushscripts-103/python/submit_maya.py")

	HTH.

-- 
Greg Ercolano, erco@(email surpressed)
Seriss Corporation
Rush Render Queue, http://seriss.com/rush/

Tel: (Tel# suppressed)ext.23
Fax: (Tel# suppressed)
Cel: (Tel# suppressed)


Last Next