2

I am using ubuntu 18.04, python 3.6.

I installed maya using :

pip install maya

then tried to run this :

import maya.cmds

then i got the module not found error.

Then i installed :

pip install maya-cmds-help

But again same error is showing. How can i get rid of this. Any help will be greatly appreciated.

SRJ577
  • 31
  • 2
  • 9
  • Are you executing this from within Maya? If so, the bundled Python interpreter should have automatically done whatever needs doing to give you access to maya.cmds. – Daniel Skovli Nov 14 '19 at 05:53
  • No, im executing the script outside maya. Is it possible ? Like im trying to create a script for searching some file types. – SRJ577 Nov 14 '19 at 06:11
  • Maya command can only used from within maya or from mayapy in commandline. And maya still uses Python 2.7. – haggi krey Nov 14 '19 at 09:20
  • Why do you specifically need maya's api to search for file types? Isn't `os` enough? – Green Cell Nov 21 '19 at 03:22
  • What i really need is a script for automatically loading missing files in the reference editor and printing out the missing files which is shown in and file path editor. Any help will be greatly appreciated. – SRJ577 Nov 28 '19 at 07:01

2 Answers2

1

The module you install https://pypi.org/project/maya/ has nothing to do with the Autodesk Maya.

ababak
  • 1,685
  • 1
  • 11
  • 23
0

If you are attempting to query and edit Maya files without opening an actual Maya session, use mayapy. It's an external Python interpreter that allows you to access maya.cmds