CGTalk > Software Specific Forums > Autodesk Maya > Maya Programming
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 08-23-2012, 04:53 AM   #1
Aikiman
Pixel Collisions
 
Aikiman's Avatar
portfolio
Jeremy Raven
Wellington, New Zealand
 
Join Date: Jun 2005
Posts: 3,582
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-23-2012, 05:05 AM   #2
stooch
Lord of the posts
 
stooch's Avatar
portfolio
Dimitri Loginowski
VFX Artist + Designer
Handsome, LLC
Beverly Hills, USA
 
Join Date: Apr 2004
Posts: 2,029
Send a message via AIM to stooch
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-23-2012 at 05:11 AM.
 
Old 08-23-2012, 05:40 AM   #3
zoharl
A newbie
 
zoharl's Avatar
portfolio
Zohar
A student
Haifa, Israel
 
Join Date: Mar 2009
Posts: 1,815
You can also declare an environment variable PYTHONPATH.
 
Old 08-23-2012, 06:17 AM   #4
Aikiman
Pixel Collisions
 
Aikiman's Avatar
portfolio
Jeremy Raven
Wellington, New Zealand
 
Join Date: Jun 2005
Posts: 3,582
Thanks guys I will try it both ways for familiarity.
__________________
www.jeremyraven.co.nz
Vimeo
 
Old 08-23-2012, 06:17 AM   #5
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 07:58 PM.


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