No module named .....

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 08 August 2012   #1
No module named .....

Seems a bit inconsistant but I have placed a python script into my scripts folder but get the above mentioned error ..."no module named..."

Is there a different directory that Maya will look for python scripts apart from the normal one for mel scripts, or do I need to set this up? How?

Thanks again.
__________________
www.jeremyraven.co.nz
Vimeo
 
Old 08 August 2012   #2
Quote:
Originally Posted by Aikiman
Seems a bit inconsistant but I have placed a python script into my scripts folder but get the above mentioned error ..."no module named..."

Is there a different directory that Maya will look for python scripts apart from the normal one for mel scripts, or do I need to set this up? How?

Thanks again.


say you have a python scripts folder at "//nas/Content/bin/python"


first you need to put your python files into that folder then
you need to specify the python folder via sys.path command like this:

from pymel.core import *; #you can also just import sys if you dont use pymel
sys.path.append("//nas/Content/bin/python"); #this points to your modules

then simply import your modules:

import module

and you are ready to go.
__________________
From Russia, with love @ stooch.tv

Last edited by stooch : 08 August 2012 at 05:11 AM.
 
Old 08 August 2012   #3
You can also declare an environment variable PYTHONPATH.
 
Old 08 August 2012   #4
Thanks guys I will try it both ways for familiarity.
__________________
www.jeremyraven.co.nz
Vimeo
 
Old 08 August 2012   #5
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 02:17 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.