Mini portable mayapy.exe packager (non GUI)

does anyone tried make a mini, portable, mayapy.exe packager?

What is that supposed to do? Package your script, mayapy.exe as single thing, and the be possible to execute on another machine where Maya is not installed?

That wont’ be possible if you’re intending to use Maya’s functionality (e.g. create and save a scene with a sphere in it). Because mayapy.exe is just a “portal” to all the native code Maya provides with it’s installation.

If that’s not specific to maya, try out any python standalone packager, but then you’re better of not using mayapy.exe and take any Python 2.7 distribution.

I don’t think MayaPy will run outside of Maya’s install directory. Py2exe or Pyfreeze is the way to go for packaged stuff

I made a portable single file python 2.7 x64 executable according to this tutorial with pyinstaller, but I am not sure what the use case is. Download link: pyexe-2.7.11.zip

Yeah, mayapy depends on a bunch of maya dlls, and a lot of those dlls depend on some environment variables.

I don’t know why you want to do it, but it can be done.
Make a new directory, copy the lib and DLLs directory inside, and then copy mayapy.exe, python26.zip and Base.dll in there. done. This is just the python interpreter. You won’t be able to do much (or anything) with maya or pymel (obviously). Anything else needs Maya installed, together with the appropriate license.

The only use for it is to easily test some non Maya dependent Python code for compatibility with older Maya Python default distributions without having to install the whole Maya app. For example in some older versions various modules were missing (e.g. no ctypes in x64 in 2011). This really made it annoying when targeting different Maya versions or when trying to import certain 3rd party modules. But nowadays this isn’t any issue any more. AD’s Python distribution is pretty standard and contains everything.