Scripts and Management

187 views
Skip to first unread message

Christopher.

unread,
Oct 17, 2015, 8:56:20 PM10/17/15
to Python Programming for Autodesk Maya
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 ? 

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 ?

Justin Israel

unread,
Oct 17, 2015, 11:19:22 PM10/17/15
to Python Programming for Autodesk Maya


On Sun, 18 Oct 2015 1:56 PM Christopher. <crestchr...@gmail.com> 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?

--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/5b6513aa-f432-4f3a-8ffa-96356d9f79ea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Crest Christopher

unread,
Oct 17, 2015, 11:36:42 PM10/17/15
to python_in...@googlegroups.com


Justin Israel wrote:


On Sun, 18 Oct 2015 1:56 PM Christopher. <crestchr...@gmail.com> 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 ?

--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/5b6513aa-f432-4f3a-8ffa-96356d9f79ea%40googlegroups.com.
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 python_inside_m...@googlegroups.com.
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.

Justin Israel

unread,
Oct 17, 2015, 11:51:37 PM10/17/15
to python_in...@googlegroups.com
On Sun, Oct 18, 2015 at 4:36 PM Crest Christopher <crestchr...@gmail.com> wrote:


Justin Israel wrote:


On Sun, 18 Oct 2015 1:56 PM Christopher. <crestchr...@gmail.com> 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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/5b6513aa-f432-4f3a-8ffa-96356d9f79ea%40googlegroups.com.
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 python_inside_m...@googlegroups.com.
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.

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 python_inside_m...@googlegroups.com.

Chris Lesage

unread,
Oct 18, 2015, 12:04:41 AM10/18/15
to python_in...@googlegroups.com
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.



Christopher.

unread,
Oct 18, 2015, 1:02:57 AM10/18/15
to Python Programming for Autodesk Maya
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 <justin...@gmail.com> wrote:
On Sun, Oct 18, 2015 at 4:36 PM Crest Christopher <crestchr...@gmail.com> wrote:


Justin Israel wrote:


On Sun, 18 Oct 2015 1:56 PM Christopher. <crestchr...@gmail.com> 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 python_inside_maya+unsub...@googlegroups.com.


--
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 python_inside_maya+unsub...@googlegroups.com.

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 python_inside_maya+unsub...@googlegroups.com.

--
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 python_inside_maya+unsub...@googlegroups.com.

Christopher.

unread,
Oct 18, 2015, 8:33:40 PM10/18/15
to Python Programming for Autodesk Maya
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 

Justin Israel

unread,
Oct 18, 2015, 8:37:21 PM10/18/15
to Python Programming for Autodesk Maya
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. <crestchr...@gmail.com> 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 <justin...@gmail.com> wrote:
On Sun, Oct 18, 2015 at 4:36 PM Crest Christopher <crestchr...@gmail.com> wrote:


Justin Israel wrote:


On Sun, 18 Oct 2015 1:56 PM Christopher. <crestchr...@gmail.com> 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 python_inside_m...@googlegroups.com.


--
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 python_inside_m...@googlegroups.com.

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 python_inside_m...@googlegroups.com.

--
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 python_inside_m...@googlegroups.com.

--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/622fb20f-75ee-4dc5-804d-45959732860e%40googlegroups.com.

Crest Christopher

unread,
Oct 18, 2015, 8:54:16 PM10/18/15
to python_in...@googlegroups.com
You tried to help; it's in my hands, thanks !

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.
<crestchr...@gmail.com <mailto:crestchr...@gmail.com>> 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.

    &nbsp ;   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
            <justin...@gmail.com> wrote:



                On Sun, Oct 18, 2015 at 4:36 PM Crest Christopher
                <crestchr...@gmail.com> wrote:



                    Justin Israel wrote:



                    On Sun, 18 Oct 2015 1:56 PM Christopher.
                    <crestchr...@gmail.com> wrote:

                        General question about scripts, some scripts
                        tell you to place them in your python
                        directory, whether that is your Maya default
         & nbsp;              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
                 &nbs p;      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
&nb sp;                       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, al though 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
            &nb sp;   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
                 & nbsp;      Programming for Autodesk Maya" group.

                        To unsubscribe from this group and stop
                        receiving emails from it, send an email to
                        python_inside_m...@googlegroups.com.
                        To view this discussion on the web visit
                        https://groups.google.com/d/ msgid/python_inside_maya/5b6513aa-f432-4f3a-8ffa-96356d9f79ea%40googlegroups.com

                        For more options, visit
                        https://groups.google.com/d/optout.


                    --
                    You receive d 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
                  &nbs p; topics, send an email to

                    python_inside_m...@googlegroups.com.
                    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>.

              &nb sp;     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 r eceiving
                    emails from it, send an email to
                    python_inside_m...@googlegroups.com.
                    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>.
       &nbsp ;            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
              & nbsp; emails from it, send an email to

                python_inside_m...@googlegroups.com.
                To view this discussion on the web visit



    --
    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 python_inside_m...@googlegroups.com

    To view this discussion on the web visit

    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
python_inside_m...@googlegroups.com

To view this discussion on the web visit
Message has been deleted

Rémi Deletrain

unread,
Oct 19, 2015, 9:02:44 AM10/19/15
to Python Programming for Autodesk Maya
Hi,

If ever it can help you. It's not a cleaned script but it works

I create this tool for laod all my scripts when maya loading. 
It's possible to reload all your scripts

for exemple with your tool in D:\work\Maya_Tools
--------------------------------------------------
sys.path.insert(0, r'D:\Work')
from Maya_Tools.divers_tools.plugin_manager import Plugin_Manager

Maya_Tools = r'D:\work'

Plugin_Manager.window_close_all_pyside() # Only work with QMainWindow
Plugin_Manager.modules_delete(['Maya_Tools'], ['plugin_manager', 'AssetImporter'])
Plugin_Manager.modules_load([Maya_Tools, ])
--------------------------------------------------

Do not forget the __init__.py file in your Scripts folder : D:\work\Maya_Tools\__init__.py
if you don't have this file in your directory Python will fail to load the scripts

As the saying everyone if no mistake in the path there should not be any problem in your script loads.

Crest Christopher

unread,
Oct 19, 2015, 9:51:38 AM10/19/15
to python_in...@googlegroups.com
Hi, sorry I didn't quite understand how your tool behaves ? ;-)

Rémi Deletrain wrote:
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/d11a55ed-16a7-49ea-9f90-2e8635f29895%40googlegroups.com.

Rémi Deletrain

unread,
Oct 19, 2015, 9:57:39 AM10/19/15
to Python Programming for Autodesk Maya
It allows reloader scripts by destroying the modules and reloading them.
Shortly be with this solution you can fix your problem

Christopher.

unread,
Oct 24, 2015, 11:10:11 AM10/24/15
to Python Programming for Autodesk Maya
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 ?

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 ? 

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 ?

To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.


--
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 python_inside_maya+unsub...@googlegroups.com.

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 python_inside_maya+unsub...@googlegroups.com.

--
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 python_inside_maya+unsub...@googlegroups.com.

--
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 python_inside_maya+unsub...@googlegroups.com.

Justin Israel

unread,
Oct 24, 2015, 2:58:17 PM10/24/15
to Python Programming for Autodesk Maya


On Sun, 25 Oct 2015 4:10 AM Christopher. <crestchr...@gmail.com> 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?

To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.

--


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 python_inside_m...@googlegroups.com.



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 python_inside_m...@googlegroups.com.


--
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 python_inside_m...@googlegroups.com.

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 python_inside_m...@googlegroups.com.

--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/59a67230-4594-40dd-aec9-2f4fe398bcf5%40googlegroups.com.

Christopher.

unread,
Oct 24, 2015, 6:53:30 PM10/24/15
to Python Programming for Autodesk Maya
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 ?

To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.

--


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 python_inside_maya+unsub...@googlegroups.com.



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 python_inside_maya+unsub...@googlegroups.com.


--
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 python_inside_maya+unsub...@googlegroups.com.

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 python_inside_maya+unsub...@googlegroups.com.


--
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 python_inside_maya+unsub...@googlegroups.com.

AK Eric

unread,
Oct 24, 2015, 10:47:23 PM10/24/15
to Python Programming for Autodesk Maya
tl;dnr this whole thread.  But you'd need to:

import SuperScript.myModule
SuperScript.myModule.myFunc()

That's executing the myFunc function in the my myModule.py module living under /SuperScript dir.
x:/../../pythonscripts/SuperScript/myModule.py

Generally, I don't often put any code in the __init__.py  (I do occasionally for very specific reasons).  In general they're just there to get your package paths setup right, so you can import everything correctly without any fuss.

Crest Christopher

unread,
Oct 24, 2015, 11:15:31 PM10/24/15
to python_in...@googlegroups.com
The script calls to be executed as such; Superscript.ui() ?


AK Eric wrote:
--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/c0949574-6c1c-43a8-9429-263e5b5b1649%40googlegroups.com.

Justin Israel

unread,
Oct 25, 2015, 3:16:52 AM10/25/15
to python_in...@googlegroups.com


On Sun, 25 Oct 2015 4:15 PM Crest Christopher <crestchr...@gmail.com> wrote:

The script calls to be executed as such; Superscript.ui() ?


No. "Superscript" is the name of the package (directory). Then you have some module which is the name of your file. So if you file is called myFile.py, then you do

import Superscript.myFile
Superscript.myFile.ui()


--

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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/562C495E.8050405%40gmail.com.

Christopher.

unread,
Oct 25, 2015, 11:30:29 AM10/25/15
to Python Programming for Autodesk Maya
I followed the instructions you posted and I got an error;
#Error: ImportError: No module name SuperScript.MySuperScript.py #

Yes there is a directory or package called SuperScript, and yes there is a file called MySuperScript.py located in the directory / package.

On Sunday, October 25, 2015 at 3:16:52 AM UTC-4, Justin Israel wrote:


On Sun, 25 Oct 2015 4:15 PM Crest Christopher <crestchr...@gmail.com> wrote:

The script calls to be executed as such; Superscript.ui() ?


No. "Superscript" is the name of the package (directory). Then you have some module which is the name of your file. So if you file is called myFile.py, then you do

import Superscript.myFile
Superscript.myFile.ui()


AK Eric wrote:

tl;dnr this whole thread.  But you'd need to:

import SuperScript.myModule

SuperScript.myModule.myFunc()

That's executing the myFunc function in the my myModule.py module living under /SuperScript dir.

x:/../../pythonscripts/SuperScript/myModule.py

Generally, I don't often put any code in the __init__.py  (I do occasionally for very specific reasons).  In general they're just there to get your package paths setup right, so you can import everything correctly without any fuss.

--


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 python_inside_maya+unsub...@googlegroups.com.


--
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 python_inside_maya+unsub...@googlegroups.com.

Justin Israel

unread,
Oct 25, 2015, 2:46:03 PM10/25/15
to Python Programming for Autodesk Maya


On Mon, 26 Oct 2015 4:30 AM Christopher. <crestchr...@gmail.com> wrote:

I followed the instructions you posted and I got an error;

#Error: ImportError: No module name SuperScript.MySuperScript.py #




Get rid of the .py part of that import command. You only use the names of the files without extensions.

import SuperScript.MySuperScript

Yes there is a directory or package called SuperScript, and yes there is a file called MySuperScript.py located in the directory / package.

On Sunday, October 25, 2015 at 3:16:52 AM UTC-4, Justin Israel wrote:


On Sun, 25 Oct 2015 4:15 PM Crest Christopher <crestchr...@gmail.com> wrote:

The script calls to be executed as such; Superscript.ui() ?

No. "Superscript" is the name of the package (directory). Then you have some module which is the name of your file. So if you file is called myFile.py, then you do

import Superscript.myFile
Superscript.myFile.ui()


AK Eric wrote:


tl;dnr this whole thread.  But you'd need to:

import SuperScript.myModule

SuperScript.myModule.myFunc()

That's executing the myFunc function in the my myModule.py module living under /SuperScript dir.

x:/../../pythonscripts/SuperScript/myModule.py

Generally, I don't often put any code in the __init__.py  (I do occasionally for very specific reasons).  In general they're just there to get your package paths setup right, so you can import everything correctly without any fuss.

--

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 python_inside_m...@googlegroups.com.


--
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 python_inside_m...@googlegroups.com.

--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/805c2316-459c-43cd-a600-63073011d205%40googlegroups.com.

Message has been deleted

Christopher.

unread,
Oct 25, 2015, 3:19:39 PM10/25/15
to Python Programming for Autodesk Maya
Same error, No module named; SuperScript.SuperScript (Package \ Script name)


On Sunday, October 25, 2015 at 2:46:03 PM UTC-4, Justin Israel wrote:


On Mon, 26 Oct 2015 4:30 AM Christopher. <crestchr...@gmail.com> wrote:

I followed the instructions you posted and I got an error;

#Error: ImportError: No module name SuperScript.MySuperScript.py #




Get rid of the .py part of that import command. You only use the names of the files without extensions.

import SuperScript.MySuperScript

Yes there is a directory or package called SuperScript, and yes there is a file called MySuperScript.py located in the directory / package.

On Sunday, October 25, 2015 at 3:16:52 AM UTC-4, Justin Israel wrote:


On Sun, 25 Oct 2015 4:15 PM Crest Christopher <crestchr...@gmail.com> wrote:

The script calls to be executed as such; Superscript.ui() ?

No. "Superscript" is the name of the package (directory). Then you have some module which is the name of your file. So if you file is called myFile.py, then you do

import Superscript.myFile
Superscript.myFile.ui()


AK Eric wrote:


tl;dnr this whole thread.  But you'd need to:

import SuperScript.myModule

SuperScript.myModule.myFunc()

That's executing the myFunc function in the my myModule.py module living under /SuperScript dir.

x:/../../pythonscripts/SuperScript/myModule.py

Generally, I don't often put any code in the __init__.py  (I do occasionally for very specific reasons).  In general they're just there to get your package paths setup right, so you can import everything correctly without any fuss.

--

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 python_inside_maya+unsub...@googlegroups.com.


--
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 python_inside_maya+unsub...@googlegroups.com.


--
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 python_inside_maya+unsub...@googlegroups.com.

Justin Israel

unread,
Oct 25, 2015, 3:22:15 PM10/25/15
to Python Programming for Autodesk Maya

Did your script name just change since the last example you gave?


To unsubscribe from this group and all its topics, send an email to python_inside_m...@googlegroups.com.


--
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 python_inside_m...@googlegroups.com.


--
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 python_inside_m...@googlegroups.com.

--
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 python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/08b6c6b3-fb8b-4ef4-acf9-8e9f40df2f3d%40googlegroups.com.

Crest Christopher

unread,
Oct 25, 2015, 3:54:39 PM10/25/15
to python_in...@googlegroups.com
No, nothing changed ?

Justin Israel wrote:

Justin Israel

unread,
Oct 25, 2015, 3:58:30 PM10/25/15
to python_in...@googlegroups.com

I followed the instructions you posted and I got an error;

#Error: ImportError: No module name SuperScript.MySuperScript.py #



 So... you went from that, to:  SuperScript.SuperScript  ?

Marcus Ottosson

unread,
Oct 25, 2015, 5:12:06 PM10/25/15
to python_in...@googlegroups.com
Are we being trolled? :O​

Justin Israel

unread,
Oct 25, 2015, 5:18:08 PM10/25/15
to python_in...@googlegroups.com


On Mon, 26 Oct 2015 10:12 AM Marcus Ottosson <konstr...@gmail.com> wrote:

Are we being trolled? :O​

I wonder the same thing, myself, with multiple threads of unsolvable problems.

Trying my best to help, as long as the responses are clear and show effort or progress. But my interest is diminishing.

I feel a good book on python programming or a tutorial on basic Mel could solve these initial problems. But it seems no upfront studying is being done.

--
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 python_inside_m...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOCEyWnnvMx31nP2F%2BpC61BkgAL8S%3DUgBJesgcLzGbeW7w%40mail.gmail.com.

Chris Lesage

unread,
Oct 26, 2015, 12:12:30 AM10/26/15
to python_in...@googlegroups.com
I also think we are being trolled at worst and unintentionally nerdsniped at best. And while I think you guys are being very gracious and patient to help solve a problem (that is the finest aspect of tech artists) at this point it seems completely wasted.

Reply all
Reply to author
Forward
0 new messages