No module named - frustration

1,703 views
Skip to first unread message

Christopher.

unread,
Apr 18, 2015, 1:14:23 AM4/18/15
to python_in...@googlegroups.com
I'm at a complete loss; I have downloaded a script and, it's late so I won't go into every last step I've tried.  What is the problem, I continue to get "no module found".  I have a maya environment file, all the paths are setup correctly, I added a module path hoping it would work, no success.  Are other scripts working, more or less yes, the odd one gives me problems, what that odd one is, is completely random.  I hope someone can help.

Justin Israel

unread,
Apr 18, 2015, 1:17:14 AM4/18/15
to python_in...@googlegroups.com
Hey Christopher, 

I would be happy to help, but honestly there isn't a lot to go on here. All I can tell you without seeing some more information, is to check your PYTHONPATH again, and make sure you don't have a module name conflicts (where it is picking up a similarly named files).

Can you point us at the script, and let us know where you have placed it on your filesystem, and what your PYTHONPATH looks like, and how you import it?

Justin


On Sat, Apr 18, 2015 at 5:14 PM Christopher. <crestchr...@gmail.com> wrote:
I'm at a complete loss; I have downloaded a script and, it's late so I won't go into every last step I've tried.  What is the problem, I continue to get "no module found".  I have a maya environment file, all the paths are setup correctly, I added a module path hoping it would work, no success.  Are other scripts working, more or less yes, the odd one gives me problems, what that odd one is, is completely random.  I hope someone can help.

--
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/a9e2289a-8c74-48a6-9d2b-a04062370b29%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Christopher.

unread,
Apr 18, 2015, 10:41:42 AM4/18/15
to python_in...@googlegroups.com


On Saturday, April 18, 2015 at 1:17:14 AM UTC-4, Justin Israel wrote:
Hey Christopher, 

I would be happy to help, but honestly there isn't a lot to go on here. All I can tell you without seeing some more information, is to check your PYTHONPATH again, and make sure you don't have a module name conflicts (where it is picking up a similarly named files).

Hi Justin, I've checked everything a dozen times, what you mean by module name conflict, how do I check this ?
 

Can you point us at the script, and let us know where you have placed it on your filesystem, and what your PYTHONPATH looks like, and how you import it?


One of the scripts, I have an issue with two and I hope I can with whomever help finally resolve, it was working, I got a nasty malware attack, now it doesn't work, I've been over this issue elsewhere and I kinda feel embarrassed because I thought I had this resolved and it doesn't work again, sorta makes me look like an idiot.  I decided well might as well look like an idiot on the Maya Python group, and face the music. 

 
The first script is NSUV (Nightshade UV Editor), I've kept things clean I have a sub-folder located within a folder,the Maya.env file points to that folder which is exclusively the PYTHONPATH folder, the same goes for SCRIPTS, ICONS etc. I import the script by the following command

import NSUV
reload (NSUV)

I hope after looking like an idiot that is, with some help, I'll be able to solve this once and for all.

Justin


On Sat, Apr 18, 2015 at 5:14 PM Christopher. <crestchr...@gmail.com> wrote:
I'm at a complete loss; I have downloaded a script and, it's late so I won't go into every last step I've tried.  What is the problem, I continue to get "no module found".  I have a maya environment file, all the paths are setup correctly, I added a module path hoping it would work, no success.  Are other scripts working, more or less yes, the odd one gives me problems, what that odd one is, is completely random.  I hope someone can help.

--
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.

johan Borgström

unread,
Apr 18, 2015, 3:41:50 PM4/18/15
to python_in...@googlegroups.com
Maybe a missing __init__.py ?

Justin Israel

unread,
Apr 18, 2015, 4:20:17 PM4/18/15
to python_in...@googlegroups.com
I just grabbed a copy of that Nightshade plugin and tried it. Worked right away. Are you sure you followed the instructions? I just copied over the contents of the bundled "scripts" directory to my Maya's scripts location. I happened to put it in the shared scripts location, on my mac:
$ ls -1 /Users/justin/Library/Preferences/Autodesk/maya/scripts 
NSUV 
calcUVStats.py 
texturePanel_NSUV.mel
texturePanel_NSUV_2015.mel 
textureWindowCreateToolBar_NSUV.mel 
textureWindowCreateToolBar_NSUV_2014.mel 
textureWindowCreateToolBar_NSUV_2015.mel

The NSUV package gets picked up because the shared scripts location is on the default Maya pythonpath

Maybe post what your installation location looks like? I haven't tried to customize my Maya.env to point specifically to this or anything. More information would be helpful.



On Sun, Apr 19, 2015 at 7:41 AM johan Borgström <jo...@petfactory.se> wrote:
Maybe a missing __init__.py ?


--
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/b51db530-6074-437e-93e0-07675264f128%40googlegroups.com.

Christopher.

unread,
Apr 18, 2015, 7:08:12 PM4/18/15
to python_in...@googlegroups.com
MAYA_SCRIPT_PATH = C:\[folder name]\[sub-folder-name]\scripts
PYTHONPATH = C:\""\""\pythonscripts\

That is exactly how I have it laid out in my Maya.env file.  All script get placed in the scripts folder, all python scripts, get placed in the python folder.  In this case NSUV gets placed in the scripts folder, I have tested it in the python scripts folder as well with no positive results.


On Saturday, April 18, 2015 at 4:20:17 PM UTC-4, Justin Israel wrote:
I just grabbed a copy of that Nightshade plugin and tried it. Worked right away. Are you sure you followed the instructions? I just copied over the contents of the bundled "scripts" directory to my Maya's scripts location. I happened to put it in the shared scripts location, on my mac:
$ ls -1 /Users/justin/Library/Preferences/Autodesk/maya/scripts 
NSUV 
calcUVStats.py 
texturePanel_NSUV.mel
texturePanel_NSUV_2015.mel 
textureWindowCreateToolBar_NSUV.mel 
textureWindowCreateToolBar_NSUV_2014.mel 
textureWindowCreateToolBar_NSUV_2015.mel

The NSUV package gets picked up because the shared scripts location is on the default Maya pythonpath

Maybe post what your installation location looks like? I haven't tried to customize my Maya.env to point specifically to this or anything. More information would be helpful.



On Sun, Apr 19, 2015 at 7:41 AM johan Borgström <jo...@petfactory.se> wrote:
Maybe a missing __init__.py ?

--
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,
Apr 19, 2015, 12:41:30 AM4/19/15
to python_in...@googlegroups.com

That is where I think your problem is. If you have made a custom script location, and set that as your maya script path, and placed a python package in there, then it won't work. Maya by default has the default script locations also on the PYTHONPATH. But in your custom Maya script location, I doubt it too is on the PYTHONPATH. Can you do the following from the Script Editor

import sys
for p in sys.path:
    print p

And confirm that you see the location where your NSUV python package exists?


On Sun, 19 Apr 2015 11:08 AM Christopher. <crestchr...@gmail.com> wrote:
MAYA_SCRIPT_PATH = C:\[folder name]\[sub-folder-name]\scripts
PYTHONPATH = C:\""\""\pythonscripts\

That is exactly how I have it laid out in my Maya.env file.  All script get placed in the scripts folder, all python scripts, get placed in the python folder.  In this case NSUV gets placed in the scripts folder, I have tested it in the python scripts folder as well with no positive results.


On Saturday, April 18, 2015 at 4:20:17 PM UTC-4, Justin Israel wrote:
I just grabbed a copy of that Nightshade plugin and tried it. Worked right away. Are you sure you followed the instructions? I just copied over the contents of the bundled "scripts" directory to my Maya's scripts location. I happened to put it in the shared scripts location, on my mac:
$ ls -1 /Users/justin/Library/Preferences/Autodesk/maya/scripts 
NSUV 
calcUVStats.py 
texturePanel_NSUV.mel
texturePanel_NSUV_2015.mel 
textureWindowCreateToolBar_NSUV.mel 
textureWindowCreateToolBar_NSUV_2014.mel 
textureWindowCreateToolBar_NSUV_2015.mel

The NSUV package gets picked up because the shared scripts location is on the default Maya pythonpath

Maybe post what your installation location looks like? I haven't tried to customize my Maya.env to point specifically to this or anything. More information would be helpful.



On Sun, Apr 19, 2015 at 7:41 AM johan Borgström <jo...@petfactory.se> wrote:
Maybe a missing __init__.py ?

--
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/667c64a9-f646-40be-b276-45606081541f%40googlegroups.com.

Christopher.

unread,
Apr 19, 2015, 9:46:07 AM4/19/15
to python_in...@googlegroups.com
I can confirm I see the location where NSUV exists using the command you posted.
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,
Apr 19, 2015, 4:06:29 PM4/19/15
to python_in...@googlegroups.com

Not sure how to solve your problem at this point then. Seems you have a ghost in the machine.
Did you try removing the custom Maya env and trying a standard install to a scripts location?


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/5ab9d017-7194-47c1-a71b-59d82d2aa4ee%40googlegroups.com.

Crest Christopher

unread,
Apr 19, 2015, 4:46:02 PM4/19/15
to python_in...@googlegroups.com
When I remove the Maya.env file, surprisingly a new Maya.env is created, now that is not the surprise, the surprise is, it loads a five month old Maya.env file, not a blank environment file, when I run the same command as mentioned;

import NSUV
reload(NSUV)

I continue to get this error; # Error: line 1: ImportError: file <maya console> line 1: No module named NSUV #. 

Justin Israel wrote:

Not sure how to solve your problem at this point then. Seems you have
a ghost in the machine.
Did you try removing the custom Maya env and trying a standard install
to a scripts location?


On Mon, 20 Apr 2015 1:46 AM Christopher. <crestchr...@gmail.com
<mailto:crestchr...@gmail.com>> wrote:

    I can confirm I see the location where NSUV exists usin g the

    command you posted.


    On Sunday, April 19, 2015 at 12:41:30 AM UTC-4, Justin Israel wrote:

        That is where I think your problem is. If you have made a
        custom script location, and set that as your maya script path,
        and placed a python package in there, then it won't work. Maya
        by default has the default script locations also on the
        PYTHONPATH. But in your custom Maya script location, I doubt
        it too is on the PYTHONPATH. Can you do the following from the
        Script Editor

        import sys
        for p in sys.path :
            print p

        And confirm that you see the location where your NSUV python
        package exists?


        On Sun, 19 Apr 2015 11:08 AM Christopher.
        <crestchr...@gmail.com> wrote:

            MAYA_SCRIPT_PATH = C:\[folder name]\[sub-folder-name]\scripts
            PYTHONPATH = C:\""\""\pythonscripts\

            That is exactly how I have it laid out in my Maya.env
            file.  All script get placed in the scripts folder, all
      &n bsp;     python scripts, get placed in the python folder.  In this

            case NSUV gets placed in the scripts folder, I have tested
            it in the python scripts folder as well with no positive
            results.


            On Saturday, April 18, 2015 at 4:20:17 PM UTC-4, Justin
            Israel wrote:

                I just grabbed a copy of that Nightshade plugin and
                tried it. Worked right away. Are you sure you followed
     &n bsp;          the instructions? I just copied over the contents of

                the bundled "scripts" directory to my Maya's scripts
                location. I happened to put it in the shared scripts
                location, on my mac:

                |$ ls -1 /Users/justin/Library/Preferences/Autodesk/maya/scripts
                NSUV
                calcUVStats.py
              &nb sp; texturePanel_NSUV.mel

                texturePanel_NSUV_2015.mel
                textureWindowCreateToolBar_NSUV.mel
                textureWindowCreateToolBar_NSUV_2014.mel
                textureWindowCreateToolBar_NSUV_2015.mel
                |

                ​

                The NSUV package gets picked up because the shared
             &nbsp ;  scripts location is on the default Maya pythonpath


                Maybe post what your installation location looks like?
                I haven't tried to customize my Maya.env to point
                specifically to this or anything. More information
                would be helpful.



                On Sun, Apr 19, 2015 at 7:41 AM johan Borgström
                <jo...@petfactory.se> wrote:

            &n bsp;       Maybe a missing __init__.py ?


                    --
                    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 ema il to

                    python_inside_m...@googlegroups.com.
                    To view this discussion on the web visit
                    https://groups.google.com/d/msgid/python_inside_maya/b51db530-6074-437e-93e0-07675264f128%40googlegroups.com.
                    For more options, visit
                    https://groups.google.com/d/optout.

            --
       &nb sp;    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 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/bkJcnVhSI0Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
python_inside_m...@googlegroups.com
<mailto:python_inside_m...@googlegroups.com>.

To view this discussion on the web visit

Ian Jones

unread,
Apr 19, 2015, 5:33:46 PM4/19/15
to python_in...@googlegroups.com


On Sun, Apr 19, 2015, 1:46 PM Crest Christopher


L
H

No lull kill LJ.lmkkhhng fog

<crestchr...@gmail.com> wrote:

When I remove the Maya.env file, surprisingly a new Maya.env is created, now that is not the surprise, the surprise is, it loads a five month old Maya.env file, not a blank environment file, when I run the same command as mentioned;

import NSUV
reload(NSUV)

I continue to get this error; # Error: line 1: ImportError: file <maya console> line 1: No module named NSUV #. 

Justin Israel wrote:


Not sure how to solve your problem at this point then. Seems you have
a ghost in the machine.
Did you try removing the custom Maya env and trying a standard install
to a scripts location?

P


P

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/553413FF.8060007%40gmail.com.

Anthony Tan

unread,
Apr 19, 2015, 6:06:58 PM4/19/15
to python_in...@googlegroups.com
I suspect this is rehashing something stupidly obvious, but are you able to just create your own generic python module (e.g. a dir within your scripts area with an __init__.py placeholder) and import it? I.e. is it a problem importing NSUV, or does the issue extend to something generic? 
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.

Crest Christopher

unread,
Apr 19, 2015, 6:28:51 PM4/19/15
to python_in...@googlegroups.com
Sorry, how do I create a generic python module, newbie to this, yet to being my python quest :)

Anthony Tan wrote:

I suspect this is rehashing something stupidly obvious, but are you
able to just create your own generic python module (e.g. a dir within
your scripts area with an __init__.py placeholder) and import it? I.e.
is it a problem importing NSUV, or does the issue extend to something
generic?
On Mon, Apr 20, 2015, at 06:45 AM, Crest Christopher wrote:

When I remove the Maya.env file, surprisingly a new Maya.env is
created, now that is not the surprise, the surprise is, it loads a
five month old Maya.env file, not a blank environment file, when I
run the same command as mentioned;
import NSUV
reload(NSUV)
I continue to get this error; # Error: line 1: Impo rtError: file
the bundled "scripts" dir ectory to my Maya's scripts

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
<mailto:python_inside_m...@googlegroups.com>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/5ab9d017-7194-47c1-a71b-59d82d2aa4ee%40googlegroups.com
<https://groups.
google.com/d/msgid/python_inside_maya/5ab9d017-7194-47c1-a71b-59d82d2aa4ee%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 group and all its topics, send an email to
python_inside_m...@googlegroups.com
<mailto:python_inside_m...@googlegroups.com>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0c7p%2BkD74WOSK-Cs9bjLAZTs9AbXE8hjZcSF39zRojVw%40mail.gmail.com

<https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0c7p%2BkD74WOSK-Cs9bjLAZTs9AbXE8hjZcSF39zRojVw%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 python_inside_m...@googlegroups.com
<mailto: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/bkJcnVhSI0Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
python_inside_m...@googlegroups.com
<mailto:python_inside_m...@googlegroups.com>.
To view this discussion on the web visit

Anthony Tan

unread,
Apr 20, 2015, 2:03:27 AM4/20/15
to python_in...@googlegroups.com
I probably should use the correct terminology - package, not module, a module being just a python file with statements in it, and a package being a way of structuring them in a file hierarchy to give you namespaces of a sort (Justin, feel free to correct me since I'm being very handwavey here). In short, it lets you use a dot notation to import packages that are split up down a filesystem tree, amongst other things.
 
 
 
By way of example, on my filesystem here, i've just created the following tree:
 
d:\devzone\scratchpad\working\foo
d:\devzone\scratchpad\working\foo\bar.py
d:\devzone\scratchpad\working.\foo\__init__.py
d:\devzone\scratchpad\working\foo\bacon
d:\devzone\scratchpad\working\foo\bacon\__init__.py
d:\devzone\scratchpad\working\food\bacon\sandwich.py
 
and then the following should work:
 
import sys
sys.path.append(r'd:\devzone\scratchpad\working')
# append the root of my package structure
 
import foo
import foo.bar
import foo.bacon
import foo.bacon.sandwich
 
For your problem, assuming that the root path of NSUV is visible Johan Bogström earlier suggested checking that you've an __init__.py and it's not missing - this is just the same check in a fashion, but even more brutal.
 
Also, as a side check - is everything cased correctly? I recall tearing my hair out once until i noticed i had two copies of a file, one with an uppercase first letter.. 
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.

Jesse Kretschmer

unread,
Apr 20, 2015, 2:52:50 AM4/20/15
to python_in...@googlegroups.com
On Mon, Apr 20, 2015 at 8:03 AM, Anthony Tan <antho...@greenworm.net> wrote:
import foo.bacon.sandwich
 

I'm getting quite hungry now. 

Justin Israel

unread,
Apr 20, 2015, 3:42:51 AM4/20/15
to python_in...@googlegroups.com


On Mon, 20 Apr 2015 6:03 PM Anthony Tan <antho...@greenworm.net> wrote:

I probably should use the correct terminology - package, not module, a module being just a python file with statements in it, and a package being a way of structuring them in a file hierarchy to give you namespaces of a sort (Justin, feel free to correct me since I'm being very handwavey here).

Lol. Why you calling me out here? You did a more descriptive job than I would have. From me, you would just have gotten a link.

To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/1429509799.1482371.255913857.4B46B936%40webmail.messagingengine.com.

Anthony Tan

unread,
Apr 20, 2015, 5:18:07 AM4/20/15
to python_in...@googlegroups.com

On Mon, 20 Apr 2015 6:03 PM Anthony Tan <antho...@greenworm.net> wrote:

I probably should use the correct terminology - package, not module, a module being just a python file with statements in it, and a package being a way of structuring them in a file hierarchy to give you namespaces of a sort (Justin, feel free to correct me since I'm being very handwavey here).


Lol. Why you calling me out here? You did a more descriptive job than I would have. From me, you would just have gotten a link.

Eh, you had the initial running on the question, so i didn't want to contradict anything and besides, you're the most likely to be able to pull me up when i'm wrong  :D
 

Crest Christopher

unread,
Apr 20, 2015, 10:10:48 AM4/20/15
to python_in...@googlegroups.com
Scripts Folder > Set in my Maya.env file, the same way it is in the compressed file. 

- Pref
-- icons
- scripts
-- NSUV < this sub-folder has the location if _init_.py

Same error as previously, unless I'm missing some instruction you're telling me ?

Anthony Tan 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/bkJcnVhSI0Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
python_inside_m...@googlegroups.com
<mailto:python_inside_m...@googlegroups.com>.
To view this discussion on the web visit

Anthony Tan

unread,
Apr 20, 2015, 11:26:28 AM4/20/15
to python_in...@googlegroups.com
What I posted wasn't going to necessarily help you directly, it was more a debugging step to work out what's wrong and/or nail down a bit further any issues. If you can't import a python pack you've created yourself, then there is indeed a bigger issue with your setup than NSUV.

At this stage it's about stripping things back to the bare metal to work out what's gone wrong, and my gut feel is that there's something squiffy about your maya pathing, so that's sort of why I wanted to see if you can get a generic package of your own creation working. 
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.

Jesse Kretschmer

unread,
Apr 20, 2015, 11:57:54 AM4/20/15
to python_in...@googlegroups.com

On Mon, Apr 20, 2015 at 5:26 PM, Anthony Tan <antho...@greenworm.net> wrote:
there's something squiffy about your maya pathing

I agree. I think this is just a pathing issue.

@Crest, run this bit of code from maya and tell me if you find NSUV. Feel free to paste back the results:
import os
import sys

for path in sys.path:
    test_path = os.path.join(path, "NSUV")
    if os.path.exists(test_path):
        print "NSUV found: %s" % test_path
    else:
        print "No NSUV found at %s" % path

Note: this code roughly represents what python does under the hood when you use "import whateva". The sys.path is just a list of paths to search. Components of PYTHONPATH are injected when python is first initialized.

Cheers,
Jesse

Crest Christopher

unread,
Apr 20, 2015, 9:27:15 PM4/20/15
to python_in...@googlegroups.com
The result is; No NSUV in any of the paths when I run the script. ;-(

Why is it, when I've placed other python scripts or MEL scripts in paths that I set in the Maya.env file, those scripts work, but NSUV and ngSkinTools which does a really wierd behavior, when I click on the ngSkinTools icon in my custom shelf, first, you think the program runs, wrong, a loft icon shows up on a new shelf by its self, then I have to click the loft icon in the newly created custom shelf, then and only then does ngSkinTools runs, strange.

>From the looks of it the setup is wrong, I've read over setting up the Maya environment file dozens of times in the documentation that I swear I can't read it anymore, it's nearly memorized and yet I'm encountering this problem, I don't even want to attempt begining to start with python until this is resolved, that and I have projects to finish, anoth er reason why I haven't upgraded to 2016 because of this issue, all I ask is to solve it.

Jesse Kretschmer wrote:


On Mon, Apr 20, 2015 at 5:26 PM, Anthony Tan
<antho...@greenworm.net <mailto:antho...@greenworm.net>> wrote:

    there's something squiffy about your maya pathing


I agree. I think this is just a pathing issue.

@Crest, run this bit of code from maya and tell me if you find NSUV.
Feel free to paste back the results:
import  os
import  sys

for  path  in  sys.path:
     test_path  =  os.path.join(path,  "NSUV")
     if  os.path.exists(test_path):
         print  "NSUV found:%s"  %  test_path
     else:
         prin t  "No NSUV found at%s"  %  path


Note: this code roughly represents what python does under the hood
when you use "import whateva". The sys.path is just a list of paths to
search. Components of PYTHONPATH are injected when python is
/first/ initialized.

Cheers,
Jesse


--
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/bkJcnVhSI0Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
python_inside_m...@googlegroups.com
<mailto:python_inside_m...@googlegroups.com>.
To view this discussion on the web visit

Justin Israel

unread,
Apr 20, 2015, 10:21:57 PM4/20/15
to python_in...@googlegroups.com
Well I don't think NSUV is doing stuff that is all that funky, because in my vanilla Maya 2015 setup, I simply drop it into the Maya shared "scripts" directory, and it works straight away. And that is because the "scripts" directory is *also* added to the PYTHONPATH. 

Did you happen to try the other recommendations, to place even a basic "hello world" test script in your desired location and confirm that you can import it? I think we have established that the funky thing here is not NSUV, but probably your specific configuration. It may be best to step away from a custom Maya.env and confirm that you are able to import basic python modules or packages in the default Maya locations. Then you can update the PYTHONPATH in your Maya.env and try placing stuff in there. If you are using a custom PYTHONPATH, then I *think* (can't confirm) that you would have to separate the NSUV directory into the PYTHONPATH location, and the mel scripts in the maya scripts path location.




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.

Nicolas Combecave

unread,
Apr 21, 2015, 2:44:13 AM4/21/15
to python_in...@googlegroups.com
I found that modules are a great way to keep things separated and organized AND working with very little overhead...
Did you try this approach?

Anthony Tan

unread,
Apr 21, 2015, 3:41:13 AM4/21/15
to python_in...@googlegroups.com
Can I suggest you may want to send the entire output of Jesse's command? What it'll do is report back every path that the python interpreter will search. If it's not in that list, it's not being searched, so you can then work out from there.

Basically: what's the actual path you want to see, and what's the list of paths you're seeing?
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.

Crest Christopher

unread,
Apr 21, 2015, 7:09:44 PM4/21/15
to python_in...@googlegroups.com
for path in sys.path:
   test_path = os.path.join(path, "NSUV")
   if os.path.exists(test_path):
       print "NSUV found: %s" % test_path
   else:
       print "No NSUV found at %s" % path
No NSUV found at C:/ProgramData/Autodesk/ApplicationPlugins/MayaBonusTools/Contents/python-2015
No NSUV found at C:/ProgramData/Autodesk/ApplicationPlugins/MayaBonusTools/Contents/python
No NSUV found at C:\Program Files\Autodesk\Maya2015\bin
No NSUV found at C:\Python27\modules
No NSUV found at C:\Custom Program Settings\Maya_Resources\pythonscripts
No NSUV found at C:\Program Files\Autodesk\Maya2015\bin
No NSUV found at C:\ProgramData\Autodesk\ApplicationPlugins\3DxMaya\Contents\scripts
No NSUV found at C:\Program Files\Autodesk\Maya2015\plug-ins\bifrost\scr ipts\presets
No NSUV found at C:\Program Files\Autodesk\Maya2015\plug-ins\bifrost\scripts
No NSUV found at C:\ProgramData\Autodesk\ApplicationPlugins\MayaBonusTools\Contents\scripts
No NSUV found at C:\Program Files\Autodesk\Maya2015\modules\MentalCore\scripts
No NSUV found at C:\Program Files\Pixar\RenderManStudio-19.0-maya2015\scripts
No NSUV found at C:\Program Files\Autodesk\Maya2015\plug-ins\fbx\scripts
No NSUV found at C:\Program Files\Autodesk\mentalrayForMaya2015\scripts\AETemplates
No NSUV found at C:\Program Files\Autodesk\mentalrayForMaya2015\scripts\mentalray
No NSUV found at C:\Program Files\Autodesk\mentalrayForMaya2015\scripts\unsupported
No NSUV found at C:\Program Files\Autodesk\mentalrayForMaya2015\scripts
No NSUV found at C:\Program Files (x86)\ngSkinTools\Maya2015-64bit\scripts
No NSUV found at C:\Program Files\Autodesk\Maya2015\plug-ins\substance\scripts
No NSUV found at C:\Program Files\Autodesk\Maya2015\pl ug-ins\xgen\scripts\cafm
No NSUV found at C:\Program Files\Autodesk\Maya2015\plug-ins\xgen\scripts\xgenm
No NSUV found at C:\Program Files\Autodesk\Maya2015\plug-ins\xgen\scripts\xgenm\ui
No NSUV found at C:\Program Files\Autodesk\Maya2015\plug-ins\xgen\scripts\xgenm\xmaya
No NSUV found at C:\Program Files\Autodesk\Maya2015\plug-ins\xgen\scripts\xgenm\ui\brushes
No NSUV found at C:\Program Files\Autodesk\Maya2015\plug-ins\xgen\scripts\xgenm\ui\dialogs
No NSUV found at C:\Program Files\Autodesk\Maya2015\plug-ins\xgen\scripts\xgenm\ui\fxmodules
No NSUV found at C:\Program Files\Autodesk\Maya2015\plug-ins\xgen\scripts\xgenm\ui\tabs
No NSUV found at C:\Program Files\Autodesk\Maya2015\plug-ins\xgen\scripts\xgenm\ui\util
No NSUV found at C:\Program Files\Autodesk\Maya2015\plug-ins\xgen\scripts\xgenm\ui\widgets
No NSUV found at C:\Program Files\Autodesk\Maya2015\plug-ins\xgen\scripts
No NSUV found at C:\Program Files\Autodesk\Maya2015\bin\ python27.zip
No NSUV found at C:\Program Files\Autodesk\Maya2015\Python\DLLs
No NSUV found at C:\Program Files\Autodesk\Maya2015\Python\lib
No NSUV found at C:\Program Files\Autodesk\Maya2015\Python\lib\plat-win
No NSUV found at C:\Program Files\Autodesk\Maya2015\Python\lib\lib-tk
No NSUV found at C:\Program Files\Autodesk\Maya2015\Python
No NSUV found at C:\Program Files\Autodesk\Maya2015\Python\lib\site-packages
No NSUV found at C:\Program Files\Autodesk\Maya2015\bin\python27.zip\lib-tk
No NSUV found at C:/Custom Program Settings/Maya_Resources/Preferences/2015-x64/prefs/scripts
No NSUV found at C:/Custom Program Settings/Maya_Resources/Preferences/2015-x64/scripts
No NSUV found at C:/Custom Program Settings/Maya_Resources/Preferences/scripts
==========================

Results of Jesse's script.

Anthony Tan wrote:

Can I suggest you may want to send the entire output of Jesse's
command? What it'll do is report back every path that the python
interpreter will search. If it's not in that list, it's not being
searched, so you can then work out from there.

Basically: what's the actual path you want to see, and what's the list
of paths you're seeing?


On Tue, Apr 21, 2015, at 11:27 AM, Crest Christopher wrote:

The result is; No NSUV in any of the paths when I run the script. ;-(
Why is it, when I've placed other python scripts or MEL scripts in
paths that I set in the Maya.env file, those scripts work, but NSUV
and ngSkinTools which does a really wierd behavior, when I click on
the ngSkinTools icon in my custom shelf, first, you think the program
runs, wrong, a loft icon shows up on a new shelf by its self, then I
have to click the loft icon in the newly created custom shelf, then
and only then does ngSkinTools runs, strange.
>From the looks o f it the setup is wrong, I've read over setting up
the Maya environment file dozens of times in the documentation that I
swear I can't read it anymore, it's nearly memorized and yet I'm
encountering this problem, I don't even want to attempt begining to
start with python until this is resolved, that and I have projects to
finish, anoth er reason why I haven't upgraded to 2016 because of
this issue, all I ask is to solve it.
Jesse Kretschmer wrote:

On Mon, Apr 20, 2015 at 5:26 PM, Anthony Tan
<antho...@greenworm.net <mailto:antho...@greenworm.net>
<mailto:antho...@greenworm.net>>> wrote:
there's something squiffy about your maya pathing
I agree. I think this is just a pathing issue.
@Crest, run this bit of code from maya and tell me if you find NSUV.
Feel free to paste back the results:
import os
import sys< BR> for path in sys.path:

test_path = os.path.join(path, "NSUV")
if os.path.exists(test_path):
print "NSUV found:%s" % test_path
else:
prin t "No NSUV found at%s" % path
Note: this code roughly represents what python does under the hood
when you use "import whateva". The sys.path is just a list of paths to
search. Components of PYTHONPATH are injected when python is
/first/ initialized.
Cheers,
Jesse
--
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/bkJcnVhSI0Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
python_inside_m...@googlegroups.com
<mailto: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

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/bkJcnVhSI0Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
python_inside_m...@googlegroups.com
<mailto:python_inside_m...@googlegroups.com>.
To view this discussion on the web visit

Justin Israel

unread,
Apr 21, 2015, 7:16:54 PM4/21/15
to python_in...@googlegroups.com
That means the location you have placed your NSUV directory is not a location that is on the PYTHONPATH, thus will not be found when you try and import it. 

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/5536D8A4.6090006%40gmail.com.

Crest Christopher

unread,
Apr 21, 2015, 7:51:47 PM4/21/15
to python_in...@googlegroups.com
The PYTHONPATH exists in the Maya.env file that is pointing to x:\6 on a drive. And it is that folder in which NSUV folder exists, although Maya is not seeing it ?

Justin Israel wrote:

That means the location you have placed your NSUV directory is not a
location that is on the PYTHONPATH, thus will not be found when you
try and import it.

On Wed, Apr 22, 2015 at 11:09 AM Crest Christopher
<crestchr...@gmail.com <mailto:crestchr...@gmail.com>> wrote:

    for path in sys.path:
       test_path = os.path.join(path, "NSUV")
       if os.path.exists(test_path):
           print "NSUV found: %s" % test_path
       else:
&nbs p;          print "No NSUV found at %s" % path

    No NSUV found at
    C:/ProgramData/Autodesk/ApplicationPlugins/MayaBonusTools/Contents/python-2015
    No NSUV found at
    C:/ProgramData/Autodesk/ApplicationPlugins/MayaBonusTools/Contents/python
    No NSUV found at C:\Program Files\Autodesk\Maya2015\bin
    No NSUV found at C:\Python27\modules
    No NSUV found at C:\Custom Program
    Settings\Maya_Resources\pythonscripts
    No NSUV found at C:\Program Files\Autodesk\Maya2015\bin
    No NSUV found at
    C:\ProgramData\Autodesk\ApplicationPlugins\3DxMaya\Contents\scripts
    No NSUV found at C:\Program
    Files\Autodesk\Maya2015\plug-ins\bifrost\scr ipts\presets
  &nb sp; No NSUV found at C:\Program
    Files\Autodesk\Maya2015\plug-in s\xgen\scripts\xgenm\ui\brushes

    No NSUV found at C:\Program
    Files\Autodesk\Maya2015\plug-ins\xgen\scripts\xgenm\ui\dialogs
    No NSUV found at C:\Program
    Files\Autodesk\Maya2015\plug-ins\xgen\scripts\xgenm\ui\fxmodules
    No NSUV found at C:\Program
    Files\Autodesk\Maya2015\plug-ins\xgen\scripts\xgenm\ui\tabs
    No NSUV found at C:\Program
    Files\Autodesk\Maya2015\plug-ins\xgen\scripts\xgenm\ui\util
    No NSUV found at C:\Program
    Files\Autodesk\Maya2015\plug-ins\xgen\scripts\xgenm\ui\widgets
    No NSUV found at C:\Program
    Files\Autodesk\Maya2015\plug-ins\xgen\scripts
    No NSUV found at C:\Program Files\Autodesk\Maya2015\bin\ python27.zip
    No NSUV found at C:\Program Files\Autodes k\Maya2015\Python\DLLs

    No NSUV found at C:\Program Files\Autodesk\Maya2015\Python\lib
    No NSUV found at C:\Program
    Files\Autodesk\Maya2015\Python\lib\plat-win
    No NSUV found at C:\Program Files\Autodesk\Maya2015\Python\lib\lib-tk
    No NSUV found at C:\Program Files\Autodesk\Maya2015\Python
    No NSUV found at C:\Program
    Files\Autodesk\Maya2015\Python\lib\site-packages
    No NSUV found at C:\Program
    Files\Autodesk\Maya2015\bin\python27.zip\lib-tk
    No NSUV found at C:/Custom Program
    Settings/Maya_Resources/Preferences/2015-x64/prefs/scripts
    No NSUV found at C:/Custom Program
    Settings/Maya_Resources/Preferences/2015-x64/scripts
    No NSUV found at C:/Custom Program
 & nbsp;  Settings/Maya_Resources/Preferences/scripts
&nb sp;   encountering this problem, I don't even want to attempt begining to
  &nb sp; /first/ initialized.

    Cheers,
    Jesse
    --
    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/bkJcnVhSI0Y/unsubscribe.
    To unsubscribe from this group and all its topics, send an email to
    python_inside_m...@googlegroups.com

    <http://gle.com/d/msgid/python_inside_maya/CANESWi0tzEaP0ro-j0uEg5icVyuXAbZaaGb2dC_ArE_ENQ0xBA%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
    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/bkJcnVhSI0Y/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

    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/bkJcnVhSI0Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
python_inside_m...@googlegroups.com
<mailto:python_inside_m...@googlegroups.com>.
To view this discussion on the web visit

Anthony Tan

unread,
Apr 21, 2015, 7:59:28 PM4/21/15
to python_in...@googlegroups.com
Interesting..
 
What's the path where you've put NSUV?
 
I notice there's no user directory there, but you do have something that approximates the structure in "C:/Custom Program Settings/Maya_Resources/Preferences/scripts"
 
Just checking, that looks awfully like a placeholder path? Or did you actually mean to have a number of directories under the literal "c:/Custom Program Settings/" root?
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.

damon shelton

unread,
Apr 21, 2015, 8:15:18 PM4/21/15
to python_in...@googlegroups.com
what is the absolute path where you have placed NSUV?
I also noticed you don't have your user/scripts path printing (usually something like this C:\Users\"YOU"\Documents\maya\2015-x64\scripts)


Crest Christopher

unread,
Apr 21, 2015, 8:38:37 PM4/21/15
to python_in...@googlegroups.com
The absolute path, which is only a place holder due to this issue is X:\6 that is set in the Maya.env file and that is also the same location where the NSUV folder is located. 

Settings/Maya_Resources/Preferences/scripts"

Just checking, that looks awfully like a placeholder path? Or did you
actually mean to have a number of directories under the literal
"c:/Custom Program Settings/" root?


That path is set in my system environment variable for the default path for Maya.

Anthony Tan wrote:

Interesting..
What's the path where you've put NSUV?
I notice there's no user directory there, but you do have something
that approximates the structure in "C:/Custom Program
Settings/Maya_Resources/Preferences/scripts"
Just checking, that looks awfully li ke a placeholder path? Or did you
Files\A utodesk\Maya2015\plug-ins\substance\scripts

No NSUV found at C:\Program Files\Autodesk\Maya2015\pl
ug-ins\xgen\scripts\cafm
No NSUV found at C:\Program
Files\Autodesk\Maya2015\plug-ins\xgen\scripts\xgenm
No NSUV found at C:\Program
Files\Autodesk\Maya2015\plug-ins\xgen\scripts\xgenm\ui
No NSUV found at C:\Program
Files\Autodesk\Maya2015\plug-ins\xgen\scripts\xgenm\xmaya
No NSUV found at C:\Program
Files\Autodesk\Maya2015\plug-ins\xgen\scripts\xgenm\ui\brushes
No NSUV found at C:\Program
Files\Autodesk\Maya2015\plug-ins\xgen\scripts\xgenm\ui\dialogs
No NSUV found at C:\Program
Files\Autodesk\Maya2015\plug-ins\xgen\scripts\xgenm\ui\fxmodules
No NSUV found at C:\Program
Files\Autodesk\Maya2015\plug-ins\xgen\scripts\xgenm\ui\tabs
No NSUV found at C:\Program
Files\Autodesk\Maya2015\plug-ins\xgen\scripts\xgenm\ui\util
No NSUV found at C:\Program
Files\Autodesk\Maya2015\plug-ins\xgen\scripts\xg enm\ui\widgets
@Crest, run this bit of code from maya and tell me if you find NSUV.
To unsubscribe from this group and stop receiv ing emails from it,

--
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/bkJcnVhSI0Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
python_inside_m...@googlegroups.com
<mailto:python_inside_m...@googlegroups.com> .
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/1429602067.3822348.256465625.51B645F0%40w
ebmail.messagingengine.com
<https://groups.google.com/d/msgid/python_inside_maya/1429602067.3822348.256465625.51B645F0%40webmail.messagingengine.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,
<mailto: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/bkJcnVhSI0Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
python_inside_m...@googlegroups.com
<mailto:python_inside_m...@googlegroups.com>.
To view this discussion on the web visit

Jesse Kretschmer

unread,
Apr 22, 2015, 6:38:24 AM4/22/15
to python_in...@googlegroups.com

On Wed, Apr 22, 2015 at 1:59 AM, Anthony Tan <antho...@greenworm.net> wrote:
I notice there's no user directory there, but you do have something that approximates the structure in "C:/Custom Program Settings/Maya_Resources/Preferences/scripts"

As Damon and Anthony have pointed out, there is a distinct lack of a folder like "Users/Documents/maya". This makes me believe that you are not operating in a "vanilla" windows environment. Someone else has their hand in your cookie jar.

Just go ahead and run:
import sys
sys.path.append("X:/6")
import NSUV

At some point you should talk to whomever else might be touching your configurations.
-jesse

Crest Christopher

unread,
Apr 22, 2015, 10:23:09 AM4/22/15
to python_in...@googlegroups.com
I have this system variable set, which defines my personal Maya application directory, from there my Maya.env file is read and that is where I set my environment variables for my paths, it's all in the documentation.

MAYA_APP_DIR
This variable defines your personal Maya application directory. This directory contains your projects and other important items:
the prefs directory
the projects directory
mayaRenderLog.txt
mayaLog
mayaJournal
the scripts directory
Maya.env, if you choose to create it, can also reside in this directory
You can only set MAYA_APP_DIR from the operating system; you cannot use Maya.env. If you set this variable in the Mac OS X operating system, you must launch Maya from the Terminal window. Otherwise, Maya will not use the set value.



Jesse Kretschmer wrote:


On Wed , Apr 22, 2015 at 1:59 AM, Anthony Tan
--
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/bkJcnVhSI0Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
python_inside_m...@googlegroups.com
<mailto:python_inside_m...@googlegroups.com>.
To view this discussion on the web visit

Christopher.

unread,
Apr 29, 2015, 9:30:21 PM4/29/15
to python_in...@googlegroups.com
I've run this command import sys
for pythonPath in sys.path:
    print pythonPath

I have 42 python paths, this may be the problem, how do I know what python path to place python scripts; since obviously the Maya.env file is not being read where the python scripts are placed ? I don't understand why I'm having this many problems for something that is relatively easy, I really must say at this point WTF.
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,
Apr 29, 2015, 9:48:17 PM4/29/15
to python_in...@googlegroups.com

I don't understand why you are having these troubles either, otherwise we might have pinpointed it long ago.

If you see your Maya.env defined PYTHONPATH in that list of 42 paths, then it means your Maya.env is being read and you can put your NSUV directory there.
If you do not see that custom path, then your Maya.env is not being read. And the correct place to put the NSUV would be any of the locations that are under the prefs or shared location (and not a system location or Maya internal application location )

Maya automatically gives you a number of locations on the PYTHONPATH. The results of "sys.path" is a combination of the custom env paths + Maya's internal paths + potentially system locations


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.

--
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/d2836700-98bf-48b0-99a7-9a751e557b97%40googlegroups.com.

Anthony Tan

unread,
Apr 29, 2015, 10:10:34 PM4/29/15
to python_in...@googlegroups.com
There's an environment config that results in the paths as per the last dump - however it's gotten into this state isn't material though, this is just a list of paths for the python interpreter to search.
 
When you run an import statement, your interpreter will roll through those paths in order (first in the list, to the last) to find something that is importable. It's either going to be a bare python file, or a directory which houses an __init__.py file. For argument's sake, I'm just going to make reference to foo.py which is a file literally called 'foo.py' and contains a single newline. 
 
Based on that, looking at your last sys.path dump, assuming you want to import foo in terms of priority the last place to be searched will be C:/Custom Program Settings/Maya_Resources/Preferences/scripts and you should put foo.py there. Theoretically, you could also shove foo.py in C:\Custom Program Settings\Maya_Resources\pythonscripts as well.  (These appear to be paths you've set explicitly via PYTHONPATH in maya.env, and implicitly via MAYA_APP_DIR in your windows environment config by the way)
 
If setting up a foo.py thing as described above works, then theoretically, NSUV should also work. If it doesn't, then well, what imports for custom packages you've installed work and where do they come from? For example, if you do an import os, and then say, print os it should tell you that it's a module loaded from C:\Program Files\Autodesk\Maya2013\bin\python26.zip\os.py 
 
It's not a *clean* way to do things, but you could theoretically slam foo.py into one of those directories where you've got a working module, just to see what the heck is going on.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.

Crest Christopher

unread,
Apr 29, 2015, 10:23:08 PM4/29/15
to python_in...@googlegroups.com
Sorry, what is this foo.py file you are referring too ?

Anthony Tan wrote:
module, just to see what the heck is goin g on.
  &n bsp;             MAYA_SCRIPT_PATH = C:\[folder

                name]\[sub-folder-name]\scripts
                PYTHONPATH = C:\""\""\pythonscripts\
                That is exactly how I have it laid out in my Maya.env
                file. All script get placed in the scripts folder,
                all python scripts, get placed in the python folder.
                In this case NSUV gets placed in the scripts folder,
    &nbsp ;           I have tested it in the python scripts folder as well

                with no positive results.
                On Saturday, April 18, 2015 at 4:20:17 PM UTC-4,
                Justin Israel wrote:

                    I just grabbed a copy of that Nightshade plugin
                    and tried it. Worked right away. Are you sure you
                    followed the instructions? I just copied over the
                    contents of the bundled "scripts" directory to my
                    Maya's scripts location. I happened to put it in
                    the shared scripts location, on my mac:

                    |$ ls -1 /Users/justin/Library/Preferences/Autodesk/maya/scripts
                    NSUV
                    calcUVStats.py
    &n bsp;               texturePanel_NSUV.mel

                    texturePanel_NSUV_2015.mel
                    textureWindowCreateToolBar_NSUV.mel
                    textureWindowCreateToolBar_NSUV_2014.mel
                    textureWindowCreateToolBar_NSUV_2015.mel
                    |


                    The NSUV package gets picked up because the
                    shared scripts location is on the default Maya
                    pythonpath

                    Maybe post what your installation location looks
                    like? I haven't tried to customize my Maya.env to
                    point specifically to this or anything. More
                    information would be helpful.


                    On Sun, Apr 19, 2015 at 7:41 AM johan Borgström
                    <jo...@petfactory.se> wrote:

                        Maybe a missing __init__.py ?

                        --
                        You received this message because you are
                        subs cribed 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
                        <https://group s.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.

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


    &nbs p;   --
        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



--
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,

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/bkJcnVhSI0Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
python_inside_m...@googlegroups.com
<mailto:python_inside_m...@googlegroups.com>.
To view this discussion on the web visit

Anthony Tan

unread,
Apr 29, 2015, 10:30:14 PM4/29/15
to python_in...@googlegroups.com
foo is just a placeholder, just like you'll see reference made in python docs to 'spam', 'eggs', (and possibly 'lumberjack') as placeholders for things.
 
If you're asking in terms of what foo.py is in the example? It's a file you make, that is literally called foo.py, and contains a single newline, so you can 'import foo' and see if you get errors.

Crest Christopher

unread,
Apr 29, 2015, 10:35:30 PM4/29/15
to python_in...@googlegroups.com
I did 'import foo' and there are no errors ?

Anthony Tan wrote:
understand why I'm having thi s many problems for something that is

relatively easy, I really must say at this point WTF.
On Sunday, April 19, 2015 at 4:06:29 PM UTC-4, Justin Israel wrote:

Not sure how to solve your problem at this point then. Seems you
have a ghost in the machine.
Did you try removing the custom Maya env and trying a standard
install to a scripts location?

On Mon, 20 Apr 2015 1:46 AM Christopher. <crestchr...@gmail.com>
wrote:

I can confirm I see the location where NSUV exists using the
command you posted.
On Sunday, April 19, 2015 at 12:41:30 AM UTC-4, Justin Israel
wrote:

That is where I think your problem is. If you have made a
custom script location, and set that as your maya script
path, and placed a python package in there, then it won't
work. Maya by default has the default script locations
also on the PYTHONPATH. But in your custom Maya script
location, I doubt it too is on the PYTH ONPATH. Can you do

the following from the Script Editor

import sys
for p in sys.path:
print p

And confirm that you see the location where your NSUV
python package exists?

On Sun, 19 Apr 2015 11:08 AM Christopher.
<crestchr...@gmail.com> wrote:

&n bsp; MAYA_SCRIPT_PATH = C:\[folder
name]\[sub-folder-name]\scripts
PYTHONPATH = C:\""\""\pythonscripts\
That is exactly how I have it laid out in my Maya.env
file. All script get placed in the scripts folder,
all python scripts, get placed in the python folder.
In this case NSUV gets placed in the scripts folder,
; I have tested it in the python scripts folder as well
with no positive results.
On Saturday, April 18, 2015 at 4:20:17 PM UTC-4,
Justin Israel wrote:

I just grabbed a copy of that Nightshade plugin
and tried it. Worked right away. Are you sure you
followed the instructions? I just copied over the
c ontents of the bundled "scripts" directory to my
&n b sp; For more options, visit https://groups.google.com/d/optout

<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
<mailto:python_inside_m...@googlegroups.com>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/d2836700-98bf-48b0-99a7-9a751e557b97%40googlegroups.com

<https://groups.google.com/d/msgid/python_inside_maya/d2836700-98bf-48b0-99a7-9a751e557b97%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 Programmin g for Autodesk Maya" group.

To unsubscribe from this topic, visit
https://groups.google.com/d/topic/python_inside_maya/bkJcnVhSI0Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
python_inside_m...@googlegroups.com
<mailto:python_inside_m...@googlegroups.com>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/1430359830.4177396.260591381.49F64D36%40webmail.messagingengine.com

<https://groups.google.com/d/msgid/python_inside_maya/1430359830.4177396.260591381.49F64D36%40webmail.messagingengine.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,
<mailto: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/bkJcnVhSI0Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
python_inside_m...@googlegroups.com
<mailto:python_inside_m...@googlegroups.com>.
To view this discussion on the w eb visit

Anthony Tan

unread,
Apr 29, 2015, 10:38:06 PM4/29/15
to python_in...@googlegroups.com
Right, so it means you can import a custom module from an arbitrary path on your system, so if you unpack NSUV into wherever you put foo.py, you should be able to import NSUV. 

Crest Christopher

unread,
Apr 29, 2015, 10:54:34 PM4/29/15
to python_in...@googlegroups.com
It works ;-) Now I move onto the other plug-in I'm having issues with !

Anthony Tan wrote:
be C:/Custo m Program Settings/Maya_Resources/Preferences/scripts and

you should put foo.py there. Theoretically, you could also shove
foo.py in C:\Custom Program Settings\Maya_Resources\pythonscripts as
well. (These appear to be paths you've set explicitly via PYTHONPATH
in maya.env, and implicitly via MAYA_APP_DIR in your windows
environment config by the way)
If setting up a foo.py thing as described above works, then
theoretically, NSUV should also work. If it doesn't, then well, what
imports for custom packages you've installed work and where do they
come from? For example, if you do an import os, and then say, print os
it should tell you that it's a module loaded from C:\Program
Files\Autodesk\Maya2013\bin\python26.zip\os.py
It's not a *clean* way to do things, but you could theoretically slam
foo.py into one of those directories where you've got a working
module, just to see what the heck is goin g on.
<https:/ /group s.google.com/d/optout>.
send an email to python_inside_m...@googlegroups.com
<mailto: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/bkJcnVhSI0Y/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
Reply all
Reply to author
Forward
0 new messages