X:\...\...\pythonscripts\

That is the path I have in my Maya Environment file, in that path I have 
for example a script

X:\...\...\pythonscripts\SuperScript\

In that sub-folder called SuperScript I have the __init__.py file when I go 
to execute the command that needs to be executed for the script, correction 
from previous, I get the error *SuperScript* is not defined ?

On Saturday, October 24, 2015 at 2:58:17 PM UTC-4, Justin Israel wrote:
>
>
> On Sun, 25 Oct 2015 4:10 AM Christopher. <[email protected] 
> <javascript:>> wrote:
>
> Justin the __init__.py file should be in the location of the rest of the 
> python scripts for the script package so if I have the script in a folder 
> along with the __init__.py file, Maya Environment variable can traverse 
> though the directories \ folders, correct ?
>
> Let's say you add this to your PYTHONPATH:
>
>    /my/custom/path 
>
> This location can have scripts directly inside of it, such as:
>
>    /my/custom/path
>       foo.py
>
> ... Which would then let you do "import foo" in Maya. 
>
> You could also have packages, by doing:
>
>    /my/custom/path
>       package1/
>          __init__.py
>
>
>          foo.py
>
> ...  Which would then let you do any of the following :
>
> import package1
> import package1.foo
> from package1 import foo
>
>
> I can't understand, I have other python scripts that are located in the 
> same custom environment pythonscripts folder, and they work, although there 
> not in sub-folders, rather thrown together, if that makes a difference ? 
>
>
> It doesn't matter if you have random scripts mixed together in one 
> directory. If you have subdirectories in there, they need to have an 
> __init__.py as well 
>
> When I try to execute; for example the script that I'm currently 
> struggling with to work in which I placed in the same custom pythonscripts 
> folder as the other pythonscripts; the only difference is this particular 
> python script is in it's own sub-folder within the pythonscript folder I 
> get the typical *cannot find procedure error* ?
>
> Are you using a Python tab in the script editor? Sounds like a Mel error. 
>
> If you follow my previous suggestions, you should not have a problem. If 
> you do have a problem still, what exactly are you trying to execute in the 
> python tab? 
>
>
> On Sunday, October 18, 2015 at 8:37:21 PM UTC-4, Justin Israel wrote:
>
> I don't really know how to respond to this, to be honest. If your script 
> is in your PYTHONPATH, then you should be able to import it. If you haven't 
> imported it, then you can't access it. If you can't import it, then you 
> have something wrong in either your environment, or you put it in a 
> sub-directory that doesnt have an __init__.py
>
> Python scripts should not go in your mel script path.
>
>
> On Mon, Oct 19, 2015 at 1:33 PM Christopher. <[email protected]> 
> wrote:
>
> I know there isn't a good error message, but out of;
>
> Cannot find procedure or Name Error file <maya console> line 1 is not 
> defined are they both one in the same with regards to error messages.  The 
> script is a python script, when placed in the custom scripts folder, I get 
> the first error; when placed in the pythonscript folder, I get the second 
> error.  The difference, one contains MEL scripts, typically, the other 
> Python. And if the script doesn't have a import command ?
>
>
>
> I've placed other Python scripts in the path which is in my environment 
> variable, and the scripts worked, if the script doesn't require 
>
> On Sunday, October 18, 2015 at 1:02:57 AM UTC-4, Christopher. wrote:
>
> I'm going to check over the paths once again, maybe something is 
> conflicting.
>
> On Sunday, October 18, 2015 at 12:04:41 AM UTC-4, Chris Lesage wrote:
>
> I imagine you are trying to call the script name and not importing it 
> first.
>
> Justin is asking you to post *exactly what are you are trying to do*, 
> what code you are trying to execute. Please don't make people on this list 
> try to guess what you are doing with hypothetical questions. This 
> disrespects the time and knowledge of the people you are calling on.
>
> Don't say "when running the script command". *Paste exactly what you are 
> trying to execute.*
>
> On Sat, Oct 17, 2015 at 11:51 PM, Justin Israel <[email protected]> 
> wrote:
>
> On Sun, Oct 18, 2015 at 4:36 PM Crest Christopher <[email protected]> 
> wrote:
>
> Justin Israel wrote:
>
>
> On Sun, 18 Oct 2015 1:56 PM Christopher. <[email protected]> wrote:
>
> General question about scripts, some scripts tell you to place them in 
> your python directory, whether that is your Maya default installation 
> directory or a custom directory set forth by your maya env variable file.  
> At the moment my scripts are all throw in a custom python scripts folder, 
> quite messy, I have begun placing the scripts within the python scripts 
> folder, but within a respectful directory for organization, and also for 
> easy upgrading of scripts, maybe some of you do this as well ? 
>
>
> They don't have to specifically be placed in Maya's python locations. They 
> just need to be in the PYTHONPATH by some means. Like you said, this may 
> have been extended via the Maya.env or otherwise. 
>
>
> Since beginning to do this, I get when running the script command, 
> whatever that may be for a particular script; I get the following error;  
> *<script 
> name> is not defined error* ?
>
>
> Is this the actual python error? What were you trying to execute, and 
> where was it located on your file system? 
>
> This is the actual error, although the script is not called <script name> 
> you knew that, that is strictly a placeholder for the actual script name. I 
> placed the script in my pythonscripts path and I get that error, does it 
> matter if the script is within a folder in the pythonscripts path ?
>
> Again... what exactly were you trying to execute?
>
> Where does this script live on the filesystem?
>
> If you are seeing that error, then something is incorrect in your 
> configured PYTHONPATH. If you are placing scripts into sub-directories of 
> your target PYTHONPATH location, make sure you are including empty 
> __init__.py files in each one. These are required in order to indicate to 
> the python import mechanism that it should traverse into these directories 
> to treat them as packages.
>
>  
>
>
> -- 
> 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 [email protected] <javascript:>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/python_inside_maya/5b6513aa-f432-4f3a-8ffa-96356d9f79ea%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/python_inside_maya/5b6513aa-f432-4f3a-8ffa-96356d9f79ea%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
> -- 
>
>
> You received this message because you are subscribed to a topic in the 
> Google Groups "Python Programming for Autodesk Maya" group.
> To unsubscribe from this topic, visit 
> https://groups.google.com/d/topic/python_inside_maya/8SgJdsUZ0b8/unsubscribe
> .
> To unsubscribe from this group and all its topics, send an email to 
> [email protected] <javascript:>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2bArC-iy8-JfZH7vzGzke84TOCpi2%2BjDLp88q5kbmn%3DQ%40mail.gmail.com
>  
> <https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA2bArC-iy8-JfZH7vzGzke84TOCpi2%2BjDLp88q5kbmn%3DQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
>
>
> For more options, visit https://groups.google.com/d/optout.
>
>
> -- 
> 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 [email protected] <javascript:>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/python_inside_maya/562313CA.4040005%40gmail.com
>  
> <https://groups.google.com/d/msgid/python_inside_maya/562313CA.4040005%40gmail.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
> -- 
> 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 [email protected] <javascript:>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA3Z2W6KYpC-%2BZJkdh%2BRSuKrJ5pKZdJTZzZ632%2BtN3KPkw%40mail.gmail.com
>  
> <https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA3Z2W6KYpC-%2BZJkdh%2BRSuKrJ5pKZdJTZzZ632%2BtN3KPkw%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>
>
>
> -- 
> 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 [email protected] <javascript:>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/python_inside_maya/622fb20f-75ee-4dc5-804d-45959732860e%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/python_inside_maya/622fb20f-75ee-4dc5-804d-45959732860e%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
> -- 
> 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 [email protected] <javascript:>.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/python_inside_maya/59a67230-4594-40dd-aec9-2f4fe398bcf5%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/python_inside_maya/59a67230-4594-40dd-aec9-2f4fe398bcf5%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
>
>

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/e51d5999-3887-40ac-ad39-b42e631cf8e6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to