Message 1 of 1
mayapy and PYTHONPATH issues
Not applicable
02-14-2013
09:30 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
MAYA 2013 Windows 7 64Bit
I'm having an issue with PYTHONPATH not being set consistently between mayapy and maya GUI. I have several modules installed in maya that successfully add their scripts folders to MAYA_SCRIPTS_PATH and PYTHONPATH in maya GUI but in mayapy when I check:
import pymel.util as util
import sys
print(util.getEnv('PYTHONPATH'))
print(sys.path)
getEnv and sys.path are different.
'getEnv('PYTHONPATH')' sees the modules scripts paths but 'sys.path' is missing the modules scripts paths and thus fail when I try to access a python file in one of those scripts folders. Is this intended behavior of maya modules?
I don't want to set them explicitly in my environment variables because of my standalone installations of python. Setting them in maya.env doesn't work either. I suppose I can copy 'getEnv('PYTHONPATH')' to sys.path in every script but that's not ideal either.
I'm having an issue with PYTHONPATH not being set consistently between mayapy and maya GUI. I have several modules installed in maya that successfully add their scripts folders to MAYA_SCRIPTS_PATH and PYTHONPATH in maya GUI but in mayapy when I check:
import pymel.util as util
import sys
print(util.getEnv('PYTHONPATH'))
print(sys.path)
getEnv and sys.path are different.
'getEnv('PYTHONPATH')' sees the modules scripts paths but 'sys.path' is missing the modules scripts paths and thus fail when I try to access a python file in one of those scripts folders. Is this intended behavior of maya modules?
I don't want to set them explicitly in my environment variables because of my standalone installations of python. Setting them in maya.env doesn't work either. I suppose I can copy 'getEnv('PYTHONPATH')' to sys.path in every script but that's not ideal either.