I'm quite addicted to it, so make a note of it. This is a personal MAYA setting method, so it probably won't work on machines without administrator privileges. It worked on Mac OS X when I ran it in the same way as this article, so I think it is useful information for Mac users.
get-pip.py is not included with mayapy by default, so you will need to download it manually. Download get-pip.py from here to a suitable location. (As of 08/22/2016)
Open the command prompt with administrator privileges in advance Change the current directory to C: / Program Files / Autodesk / Maya2016 / bin where mayapy is stored. (Different if the installation destination is not the default)
$ cd "C:/Program Files/Autodesk/Maya2016/bin"
Then run get-pip.py.
$ mayapy "(get-pip.Path to py)/get-pip.py"
At this point, the pip installation will begin. However, it seems that there are cases where it can be installed successfully and cases where it cannot be installed. If you're successful, leave the command prompt as it is, skip the rest of the article, and move on to Numpy settings.
If you couldn't download successfully, is the following error displayed in red?
UnicodeDecodeError: 'ascii' codec can't decode byte 0x8d in position 1: ordinal not in range(128)
This seems to be an error caused by the Japanese content in either directory or administrator name. To prevent this, place a script that customizes the settings in the mayapy site-packages folder. From My Computer, go to ** C: / Program Files / Autodesk / Maya2016 / Python / Lib / site-packages ** and go to Create a file called "** sitecustomize.py **" and write the following script.
sitecustomize.py
import sys
sys.setdefaultencoding("cp932")
Then run get-pip.py again and you should be able to install it successfully.
If you have pip installed, the rest is easy. Write the following in the command prompt that remains open with administrator privileges. If you have closed the prompt, please reset the current directory to the folder where mayapy is located.
$ mayapy -m pip install --upgrade numpy
This completes the installation. Thank you for your hard work.
I will write the Mac version when I feel like it.
Recommended Posts