title: How do i append to the Maya PYTHONPATH?
body: <p>I am working through Practical Maya Programming, and trying to set a 'development root' on my PC, I have followed the instructions (below) exactly but it is not working - At the point where I type 'mayapy.exe' I get the warning "'mayapy.exe' is not recognized as an internal or external command, operable program or batch file."</p>
  
  <p><strong>From the book:</strong></p>
  
  <p>Let's decide where we will do our coding. We'll call this location the development root for the rest of the book. To be concise, I'll choose C:\mayapybook\pylib to house all of our Python code.</p>
  
  <p>Create the development root folder, and inside of it create an empty file named minspect.py.</p>
  
  <p>Now, we need to get C:\mayapybook\pylib onto Python's sys.path so it can be imported. The easiest way to do this is to use the PYTHONPATH environment variable. From a Windows command line you can run the following to add the path, and ensure it worked:</p>
  
  <pre><code>&gt; set PYTHONPATH=%PYTHONPATH%;C:\mayapybook\pylib
  &gt; mayapy.exe
  &gt;&gt;&gt; import sys
  &gt;&gt;&gt; 'C:\\mayapybook\\pylib' in sys.path
  True
  &gt;&gt;&gt; import minspect
  &gt;&gt;&gt; minspect
  &lt;module 'minspect' from '...\minspect.py'&gt;
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>This is how it is working for me at the moment:</p>
  
  <pre><code>PS C:\Users\Me&gt; set PYTHONPATH=%PYTHONPATH%;C:\mayapybook\pylib
  C:\mayapybook\pylib : The term 'C:\mayapybook\pylib' is not recognized as the name of a cmdlet, function, script file,
  or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and
  try again.
  At line:1 char:29
  + set PYTHONPATH=%PYTHONPATH%;C:\mayapybook\pylib
  +                             ~~~~~~~~~~~~~~~~~~~
      + CategoryInfo          : ObjectNotFound: (C:\mayapybook\pylib:String) [], CommandNotFoundException
  + FullyQualifiedErrorId : CommandNotFoundException
  </code></pre>
  
  <p>So the code from the book is not working but the code from the post by DrHaze seems to:</p>
  
  <pre><code>PS C:\Users\Me&gt; setx PATH "%PATH%C:\mayapybook\pylib\"
  
  SUCCESS: Specified value was saved.
  </code></pre>
  
  <p>But when I run the Maya Python Interpreter and check if C:\mayapybook\pylib\ is in sys path it returns false:</p>
  
  <pre><code>&gt;&gt;&gt; 'C:\\mayapybook\\pylib' in sys.path
  False
  </code></pre>