The PYTHONPATH environment variable is within the Maya.env file with a 
absolute path. 

python("import sys;sys.path.append('C:\Python27\Lib\site-packages');

The above line, is the only line in my userSetup.mel file, when Maya starts 
shouldn't it read that line, find the Python Modules, then I simply run any 
Python script and the script runs, it sounds that simple but it's not 
working out that simple ?

On Friday, April 1, 2016 at 4:26:19 PM UTC-4, Justin Israel wrote:
>
> Let's just cut to the chase and you tell me where your scripts *are* 
> located? 
> Obviously your standard environment has those locations in the PYTHONPATH 
> and Maya's env does not. 
>
> It isn't a complicated concept. If you add the locationa of your scripts 
> and dependencies to the sys.path in Maya, then you should be able to import 
> your scripts 
>
> On Sat, 2 Apr 2016 9:21 AM Crest Christopher <[email protected] 
> <javascript:>> wrote:
>
>> No. 
>>
>> When I had a system environment variable set for Python modules, I didn't 
>> have all the Python scripts in the Python modules path and the scripts 
>> worked perfectly.
>>
>> Justin Israel wrote:
>>
>>
>> Are you python scripts inside that location?
>>
>> On Sat, Apr 2, 2016 at 8:04 AM Christopher. 
>>
>> <[email protected] <javascript:> <mailto:[email protected] 
>> <javascript:>>> wrote:
>>
>>     The userSetup.mel file is located in; C:\<custom folder>\<custom
>>     folder>\Preferences\2015-x64\scripts
>>     Since I never had a userSetup.mel file; the following is the only
>>     line within: python("import
>>     sys;sys.path.append('C:\Python27\Lib\site-packages');
>>
>>     When restarting Maya, all Python scripts don't work, the Pyth on
>>     modules continue not to be found ?
>>
>>
>>     On Wednesday, March 30, 2016 at 3:41:38 PM UTC-4, Christopher. wrote:
>>
>>         I meant, /what we all know/, in other words, if scripts can't
>>         find python modules, /most/ of the time they won't execute.
>>
>>
>>
>>         All python scripts are relying on Python modules, as I
>>         mentioned I had the Python module path in my system
>>         environment variable; but since deleted it from my system
>>         environment variable.  Prior to deleting the path, any and all
>>         Python scripts in my custom path would work, thereafter
>>         deletion of the path from my system environment variable, they
>>         stopped working.
>>
>>         Geordie mentioned to put the script path as he posted, rather
>>         then in my system environment variable into a userSetup.mel
>>         file then those modules would load and hopefully all my python
>>         scripts would begin working, once again; up to this point,
>>         that is not the case and I'd like to know what I'm doing wrong
>>         or what has become tangled so to speak ?
>>
>>         On Wednesday, March 30, 2016 at 3:11:31 PM UTC-4, Justin
>>         Israel wrote:
>>
>>
>>
>>             O n Thu, 31 Mar 2016 8:00 AM Christopher.
>>
>>
>>             <[email protected]> wrote:
>>
>>                 If you were implying that I should use the path
>>                 Python27/Lib/site-packages instead of
>>                 Python27/modules; I tried the change but the result
>>                 was the same.
>>
>>                 As I stated in my original post, I don't recall the
>>                 Python path which I had in my environment system path;
>>                 what I can recall is, whatever path is was, any and
>>                 all Python scripts would simply execute because as we
>>                 all know, the python modules were found to run the
>>                 scripts.
>>
>>
>>             I'm having trouble following your language. I can't agree
>>             with the claim of what "we we all all know" because I
>>             didn't understand it.
>>
>>             Where is the s cript or dependency you need, located on
>>
>>
>>             your system? You are are trying to import a script in Maya
>>             and something is failing. Where did you put it?
>>
>>
>>
>>                 On Wednesday, March 30, 2016 at 2:20:11 PM UTC-4,
>>                 Justin Israel wrote:
>>
>>                     Does your script or dependency live under
>>                     Python27/modules? Or does it live under
>>
>>                &nbsp ;    Python27/Lib/site-packages?
>>
>>
>>
>>
>>                     On Thu, 31 Mar 2016 1:05 AM Christopher.
>>                     <[email protected]> wrote:
>>
>>                         I have a custom MAYA_APP_DIR in the system
>>                         environment variable to which that creates a
>>                         custom default maya installation path, rather
>>
>>        &n bsp;                it being MyDocuments>Maya>etc in Windows it
>>
>>
>>                         defaults to the custom Maya path, which
>>                         contains as the default Maya path
>>
>>                         2015-x64
>>                         - prefs
>>                         - presets
>>
>>    &n bsp;                    - scripts
>>
>>
>>                         etc
>>
>>                          I didn't have a userSetup.mel file in the
>>                         Custom 2015-x64 > scripts path in Windows so I
>>                         simply created it, placed the following path &
>>
>>                      & nbsp;  code within; python("import
>>
>>
>>                         sys;sys.path.append('C:\Python27\modules');
>>                         restarted Maya, attempted to start a Python
>>                         script which searched for Python modules and
>>                         nothing ?
>>
>>
>>
>>
>>                         On Wednesday, March 30, 2016 at 3:08:58 AM
>>
>>     & nbsp;                   UTC-4, Justin Israel wrote:
>>
>>                             He was just showing you how to append any
>>                             number of paths,if your have multiple
>>                             locations. It sounds like you only need one.
>>
>>
>>                             On Wed, 30 Mar 2016 2:49 PM Christopher. 
>>                             <[email protected]> wrote:
>>
>>                                 I have two question, one of these
>>                                 paths are incorrect; I'm leaning
>>                                 towards the second path as I didn't
>>
>>                 &nbs p;               quite understand the pseudo path
>>
>>
>>                                 X:\some\path\python, whether I should
>>                                 just enter the same path, as in
>>                                 C:\Python again; as I said, I'm
>>
>>                                 prob ably mis-understanding !
>>
>>
>>
>>                                 python("import
>>                                 
>> sys;sys.path.append('C:\Python27');sys.path.append('C:\Python27');");
>>
>>
>>                                 On Tuesday, March 29, 2016 at 1:02:06
>>                                 AM UTC-4, Geordie Martinez wrote:
>>
>>    &n bsp;                                You can add them to your
>>
>>
>>                                     userSetup.mel or userSetup.py
>>                                     files in your scripts directory.
>>                                     just add it like this:
>>
>>      &nbs p;                              userSetup.mel:
>>
>>
>>
>>                                     |python("import
>>                                     
>> sys;sys.path.append('S:/python');sys.path.append('X:/some/path/python');");|
>>
>>                                     ​
>>
>>       & nbsp;                             As soon as Maya loads the 
>> path(s)
>>
>>
>>                                     will be available. this is the
>>                                     easiest way. And you can have it
>>                                     load any modules there you want to
>>
>>      &nbs p;                              load automatically.
>>
>>
>>                                     if you have a package you would
>>                                     like to load, then it's best to
>>                                     put it in the site-packages
>>
>>         &nbs p;                           directory in your maya install
>>
>>
>>
>>
>>                                     On Mon, Mar 28, 2016 at 9:36 PM,
>>                                     Crest Christopher
>>                                     <[email protected]> wrote:
>>
>>                                          Thanks for the info.  ;-)
>>
>>                                         I just want to know what is
>>                                         the path used so I can append
>>
>>                                      &nbsp ;  it to my system environment
>>
>>
>>                                         variable MAYA_APP_DIR so
>>                                         Python modules are loaded by
>>                                         default for Maya.
>>
>>
>>
>>
>>                    &nb sp;                    Geordie Martinez
>>
>>
>>                                         Tuesday, March 29, 2016 12:17 AM
>>                                         If I were you I'd just
>>                                         install Anaconda and let
>>
>>         &nbsp ;                               Anaconda deal with appending
>>
>>
>>                                         variables based on versions.
>>
>>                                         
>> https://www.continuum.io/downloads
>>
>>
>>                                     &n bsp;   -- 
>>
>>                                         You received this message
>>                                         because you are subscribed to
>>                                         a topic in the Google Groups
>>
>>                            & nbsp;            "Python Programming for
>>
>>
>>                                         Autodesk Maya" group.
>>                                         To unsubscribe from this
>>                                         topic, visit
>>
>>                   &nbsp ;                     
>> https://groups.google.com/d/topic/python_inside_maya/CzEXgn-GIaI/unsubscribe
>> .
>>
>>
>>                                         To unsubscribe from this
>>                                         group and all its topics,
>>                                         send an email to
>>
>> & nbsp;                                       
>> [email protected] <javascript:>.
>>
>>
>>                                         To view this discussion on
>>                                         the web visit
>>
>>                               &nbs p;         
>> https://groups.google.com/d/msgid/python_inside_maya/CABPXW4jT6N6L91Kb7DTkZiOijy6ASNDm0pOCUKWUXrXnCMqNPw%40mail.gmail.com
>>                                         <
>> https://groups.google.com/d/msgid/python_inside_maya/CABPXW4jT6N6L91Kb7DTkZiOijy6ASNDm0pOCUKWUXrXnCMqNPw%40mail.gmail.com?utm_medium=email&utm_source=footer
>> >.
>>                                         For more options, visit
>>                        &nb sp;                
>> https://groups.google.com/d/optout.
>>
>>
>>                                         Christopher.
>>                                         Monday, March 28, 2016 10:00 PM
>>                                         I have Python 2.6 (26) &
>>
>>           &nbsp ;                             Python 2.7 (27) installed,
>>
>>
>>                                         what is the path used for the
>>                                         modules to append to a system
>>                                         environment
>>                                         variable; 
>> C:\Python27\modules\modules
>>                                         ?
>>                                         -- 
>>
>>                                       & nbsp; You received this message
>>
>>
>>                                         because you are subscribed to
>>                                         a topic in the Google Groups
>>                                         "Python Programming for
>>
>>                          &nbs p;              Autodesk Maya" group.
>>
>>
>>                                         To unsubscribe from this
>>                                         topic, visit
>>                                         
>> https://groups.google.com/d/topic/python_inside_maya/CzEXgn-GIaI/unsubscribe
>> .
>>
>>         &n bsp;                               To unsubscribe from this
>>
>>
>>                                         group and all its topics,
>>                                         send an email to
>>                                         python_inside_maya+u 
>> [email protected] <javascript:>.
>>                                         To view this discussion on
>>                                         the web visit
>>
>>                                         
>> https://groups.google.com/d/msgid/python_inside_maya/9a38daef-9c8e-4d80-8db3-52411b381dd0%40googlegroups.com
>>                                          <
>> https://groups.google.com/d/msgid/python_inside_maya/9a38daef-9c8e-4d80-8db3-52411b381dd0%40googlegroups.com?utm_medium=email&utm_source=footer
>> >.
>>
>>
>>                                         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
>>
>>            &nbsp ;                            Programming for Autodesk 
>> Maya"
>>
>>
>>                                         group.
>>                                         To unsubscribe from this group
>>                                         and stop receiving emails from
>>
>> &nbsp ;                                       it, send an email to
>>
>>
>>                                         
>> [email protected] <javascript:>.
>>                                         To view this discussion on the
>>
>>                              &nb sp;          web visit
>>                                         
>> https://groups.google.com/d/msgid/python_inside_maya/56FA063B.4090507%40gmail.com
>>                                         <
>> https://groups.google.com/d/msgid/python_inside_maya/56FA063B.4090507%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
>>
>>   &n bsp;                             "Python Programming for Autodesk 
>> Maya"
>>
>>
>>                                 group.
>>                                 To unsubscribe from this group and
>>                                 stop receiving emails from it, send an
>>                                  email to
>>                                 
>> [email protected] <javascript:>.
>>                                 To view this discussion on the web
>>                                 visit
>>
>>                                 
>> https://groups.google.com/d/msgid/python_inside_maya/cb713ad 
>> 4-8a41-4daf-bfa4-5c9c5c144e49%40googlegroups.com 
>> <https://groups.google.com/d/msgid/python_inside_maya/cb713ad4-8a41-4daf-bfa4-5c9c5c144e49%40googlegroups.com>
>>                                 <
>> https://groups.google.com/d/msgid/python_inside_maya/cb713ad4-8a41-4daf-bfa4-5c9c5c144e49%40googlegroups.com?utm_medium=email&utm_source=footer
>> >.
>>
>>
>>                                 For more options, visit
>>                                 https://groups.google.com/d/optout.
>>
>>                         -- 
>>                         You received this message because you are
>>                         subscribed to the Google Groups "Python
>>                         Programming for Autodesk Maya" group.
>>                         To unsubscribe from this group and stop
>>                         receiving emails from it, send an email to
>>
>>            & nbsp;            
>> [email protected] <javascript:>.
>>
>>
>>                         To view this discussion on the web visit
>>
>>                         
>> https://groups.google.com/d/msgid/python_inside_maya/5516d024-21d5-4da6-9405-37a6503d474b%40googlegroups.com
>>                         <
>> https://groups.google.com/d/msgid/python_inside_maya/5516d024-21d5-4da6-9405-37a6503d474b%40googlegroups.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 receiving
>>
>>                 emails from it, send an emai l to
>>
>>
>>                 [email protected] 
>> <javascript:>.
>>                 To view this discussion on the web visit
>>
>>                 
>> https://groups.google.com/d/msgid/python_inside_maya/c5219c9d-5eb2-4b60-823f-48bc1485d43c%40googlegroups.com
>>                 <
>> https://groups.google.com/d/msgid/python_inside_maya/c5219c9d-5eb2-4b60-823f-48bc1485d43c%40googlegroups.com?utm_medium=email&utm_source=footer
>> >.
>>
>>
>>                 For more options, visit
>>                 https://groups.google.com/d/optout. 
>>
>>     -- 
>>     You received this message because you are subscribed to the Google
>>     Groups "Python Programming for Autodesk Maya" group.
>>     To unsubscribe from this group and stop receiving emails from it,
>>     send an email to [email protected] 
>> <javascript:>
>>
>>     <mailto:[email protected] <javascript:>
>> >.
>>
>>
>>     To view this discussion on the web visit
>>
>>     
>> https://groups.google.com/d/msgid/python_inside_maya/360602d4-c5b4-4273-bf75-02a6be2cb1d4%40googlegroups.com
>>     <
>> https://groups.google.com/d/msgid/python_inside_maya/360602d4-c5b4-4273-bf75-02a6be2cb1d4%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 subscribe d 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/CzEXgn-GIaI/unsubscribe
>> .
>> To unsubscribe from this group and all its topics, send an email to 
>> [email protected] <javascript:> 
>>
>> <mailto:[email protected] <javascript:>>.
>>
>>
>> To view this discussion on the web visit 
>>
>>
>> https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA1N%3Dh7iG8hd6JMUosF%3DUQJruTaXQPo5LpZMhz2v6ywyNQ%40mail.gmail.com
>>  
>> <
>> https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA1N%3Dh7iG8hd6JMUosF%3DUQJruTaXQPo5LpZMhz2v6ywyNQ%40mail.gmail.com?utm_medium=email&utm_source=footer
>> >.
>>
>>
>> For more options, visit https://groups.google.com/d/optout.
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Python Programming for Autodesk Maya" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected] <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/python_inside_maya/56FED818.90800%40gmail.com
>>  
>> <https://groups.google.com/d/msgid/python_inside_maya/56FED818.90800%40gmail.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/beb1201e-4615-41b1-aef5-2dc2049e864d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to