Adding Maya python auto completion to Visual Studio 2013/2015

After I switched from PyCharm IDE to Visual Studio, just because I`m used to it and it works better in terms of debugging with Maya in my opinion, I found that IntelliSence is not working as it supposed to be. After a short investigation and reading a bunch forums, I found that it is a quite common issue, but luckily there is a quite simple solution.

So, to make auto completion work in VS with your Maya, you need to install  PTVS first. You can download it here http://pytools.codeplex.com/

After that let’s make a new python project

Step_1

 

 

Once you done, let’s add a search path, so the VS will know where to look at auto completion files.

 

Step_2

And now you need to add these folders you your paths:

  • C:\Program Files\Autodesk\Maya2016\Python\Lib\site-packages;
  • C:\Program Files\Autodesk\Maya2016\devkit\other\pymel\extras\completion\py\maya;
  • C:\Program Files\Autodesk\Maya2016\Python\Lib\site-packages\pymel\core;
  • C:\Program Files\Autodesk\Maya2016\lib;
  • C:\Program Files\Autodesk\Maya2016\devkit\other\pymel\extras\completion\py

After that make sure that you’ve setted up a python environment. To do that you need to go to  TOOLS>Options>Python tools>Environment Options.

Step_3

That’s it! Now IntelliSence should work.

Step_4

If you have some questions, feel free to contact me.

 

UPD:

If you have a fresh windows installation, make sure that you made a link to the maya python module. Just  go to the maya bin folder, for example like this “c:\Program Files\Autodesk\Maya2015\bin”. Then open cmd from here  as an administrator and type  mklink python.exe mayapy.exe. After that create a environment variable  PYTHONPATH=”c:\Program Files\Autodesk\Maya2015\bin\python.exe”

6 Comments

  • Alex Says

    Hello greate article, but i cant get auto completeion.
    Can you suggest me something?
    Tnaks.

  • Scott Says

    Hi,

    I am mostly a business application person moving over to your world with no exposure to python. I like the look of pymel and hope to utilize that over python. I see references in your links to this but am wondering if anything different needs to be done to set this up within VS? Your UPD comment is causing VS to read MayaPY instead of ord. PY?

    • Michael M. Says

      Heh, may be too late, but still.
      The article you see here is just like a hint for myself too. So, I was writing it right after installing and make it work. i’d say no, you don’t need to do something else, but this may be different on other windows version. Can’t be sure here, sorry.

  • Matt Says

    Hello there.

    Wondering if you might be able to help me out with this. I’ve installed Visual Studio Code (the free version) version 1.8.0. I’ve installed both the Python (Don Jayamanne) and MayaPort extensions. I’m able to send my scripts to Maya from Visual Studio, but I seem to be missing the Maya command completion. Some of what you’ve outlined above is not found with my version of VS. I’ve also set up the following environment variable.

    PYTHONPATH:
    C:\Program Files\Autodesk\Maya2015\Python\Lib\site-packages

    Any help would be great.

    Thanks.

    • Michael M. Says

      Hi! Sorry for late answer. Looks like i have to setup email notifications.

      Did you installed python tools for VS?
      Python Tools
      Your python path must be “C:\Program Files\Autodesk\Maya2015\lib;C:\Program Files\Autodesk\Maya2015\bin”

Leave a Reply

Your email address will not be published. Required fields are marked *