Home Technical Talk

[SOLVED] In Sublime3 can't get Maya Python autocompletion to work, help?

unit187
polycounter lvl 9
Offline / Send Message
unit187 polycounter lvl 9
Hey, I have this problem with getting Sublime to autocomplete Maya Python commands. Spent a few days on this problem, still can't find any solution.

I've installed "Maya Sublime" and "Jedi" packages for Sublime, of course. I suppose Jedi is supposed to assist with autocompletion, and as far as I can see I need to connect it with Maya devkit, where all Maya Python commands are stored. I thought I need to setup custom Python interpreter for Jedi, I followed their github instructions, but I guess I either use wrong syntax or typing it at wrong place.

Could anyone give a hint on how to setup it properly? Thanks!

Replies

  • Saf
    Options
    Offline / Send Message
    Saf polycounter lvl 11
  • unit187
    Options
    Offline / Send Message
    unit187 polycounter lvl 9
    Saf, I tried to plug in the path in both sublime project file (in my case RigLibrary.sublime-project) and in Jedi settings file (sublime_jedi.sublime-settings). I ended up just plugging the path everywhere I could in these files, but it still doesn't work. What am I missing? Where specifically should I put the path?
    RigLibrary.sublime-project file now looks like this (note I tried both forward and backslashes to be sure I don't mess them up, it doesn't help):
    Z:\\Program Files\\Autodesk\\Maya2015\\devkit\\other\\pymel\\extras\\completion\\py",
    {
    	"folders":
    	[
    		{
    			"path": "."
    		}
    	],
    
    	"settings":
    	{
    	// ...
            "python_interpreter": "
    	"python_package_paths":
    	[
    		"Z:\\Program Files\\Autodesk\\Maya2015\\devkit\\other\\pymel\\extras\\completion\\py"
    	]
    	}
    }
    

    And excerpt from jedi settings
    
        // Used to get the `PYTHONPATH`.
        // You can set a path to your python interpreter,
        // for example `/home/user/.virtualenvs/myenv/bin/python)`.
        "python_interpreter": "Z:\\Program Files\\Autodesk\\Maya2015\\devkit\\other\\pymel\\extras\\completion\\py",
    
        // Additional python package paths.
         "python_package_paths": ["Z:\\Program Files\\Autodesk\\Maya2015\\devkit\\other\\pymel\\extras\\completion\\py"],
    

  • Saf
    Options
    Offline / Send Message
    Saf polycounter lvl 11
  • unit187
    Options
    Offline / Send Message
    unit187 polycounter lvl 9
    Finally got it working! Saf, thanks for the link! It helped on the journey, though there was 1 final step that I discovered I had to do in order to make autocompletion work. That is to specify Python path all the way up to "python.exe". In my case it was:

    
    "Z:/Python27/python.exe"
    

Sign In or Register to comment.