Try installing ** pip ** with mayapy. This is a continuation of this article. If you say "mayapy ...?", I think you should read it first.
mayapy --Python in Maya http://qiita.com/it_ks/items/5045c99461cb6edef761
There seem to be several ways (tools) to manage Python packages. This time, refer to the contents here
Python package management technology summary (pip, setuptools, easy_install, etc) http://www.yunabe.jp/docs/python_package_management.html
Select ** pip **, which is considered to be the most modern as of December 2014.
pip ** Official documentation ** about installing
https://pip.pypa.io/en/stable/installing/
Articles explained in Japanese
How to use pip (2014/1 version) @ I'll write it somehow. http://tdoc.info/blog/2014/01/15/pip.html
In addition, it should be noted It seems that it is ** included ** in Python 2.7.9 or later. So, the version of Maya embedded Python will be upgraded soon, You will be able to use pip without doing anything.
As of Maya2016, mayapy is ** Python 2.7.6 **.
get-pip.py
Download get-pip.py
from the official documentation and
Hit this in Python and you're done.
As of 20160103, download from here> https://bootstrap.pypa.io/get-pip.py
Or here too> https://raw.github.com/pypa/pip/master/contrib/get-pip.py
Here, instead of so-called Python, ** mayapy ** takes on that role. In other words
python get-pip.py
↓
mayapy get-pip.py
is.
cd
to move to where mayapy is
cd "C:\Program Files\Autodesk\Maya2016\bin"
mayapy "path\to\get-pip.py"
python
$ mayapy "path\to\get-pip.py"
Collecting pip
Using cached pip-7.1.2-py2.py3-none-any.whl
Collecting setuptools
Using cached setuptools-19.2-py2.py3-none-any.whl
Collecting wheel
Using cached wheel-0.26.0-py2.py3-none-any.whl
Installing collected packages: pip, setuptools, wheel
Successfully installed pip-7.1.2 setuptools-19.2 wheel-0.26.0
Successfully installed pip-7.1.2 setuptools-19.2 wheel-0.26.0
That's why
Has been installed.
python
> mayapy "path\to\get-pip.py"
Collecting pip
Using cached pip-7.1.2-py2.py3-none-any.whl
Collecting setuptools
Downloading setuptools-19.2-py2.py3-none-any.whl (463kB)
100% |################################| 466kB 568kB/s
Collecting wheel
Using cached wheel-0.26.0-py2.py3-none-any.whl
Installing collected packages: pip, setuptools, wheel
Exception:
Traceback (most recent call last):
File "c:\users\{user}\appdata\local\temp\tmpj8cvx2\pip.zip\pip\basecommand.py", line 211, in main
status = self.run(options, args)
File "c:\users\{user}\appdata\local\temp\tmpj8cvx2\pip.zip\pip\commands\install.py", line 311, in run
root=options.root_path,
File "c:\users\{user}\appdata\local\temp\tmpj8cvx2\pip.zip\pip\req\req_set.py", line 646, in install
**kwargs
File "c:\users\{user}\appdata\local\temp\tmpj8cvx2\pip.zip\pip\req\req_install.py", line 803, in install
self.move_wheel_files(self.source_dir, root=root)
File "c:\users\{user}\appdata\local\temp\tmpj8cvx2\pip.zip\pip\req\req_install.py", line 998, in move_wheel_files
isolated=self.isolated,
File "c:\users\{user}\appdata\local\temp\tmpj8cvx2\pip.zip\pip\wheel.py", line 339, in move_wheel_files
clobber(source, lib_dir, True)
File "c:\users\{user}\appdata\local\temp\tmpj8cvx2\pip.zip\pip\wheel.py", line 310, in clobber
ensure_dir(destdir)
File "c:\users\{user}\appdata\local\temp\tmpj8cvx2\pip.zip\pip\utils\__init__.py", line 71, in ensure_dir
os.makedirs(path)
File "C:\Program Files\Autodesk\Maya2016\bin\python27.zip\os.py", line 157, in makedirs
mkdir(name, mode)
WindowsError: [Error 5]Access denied.: 'C:\\Program Files\\Autodesk\\Maya2016\\Python\\Lib\\site-
packages\\pip'
… Access is denied and the installation cannot be completed.
There is a folder called ** "Python" ** under the Maya installation folder, It will be placed there with the following feelings.
mayapy's PYTHON HOME
>>> import os
>>> os.environ['PYTHONHOME']
'C:\\Program Files\\Autodesk\\Maya2016\\Python'
A ** "Scripts" ** folder will be created directly underneath. Related exes such as "easy_install.exe", "pip.exe" and "wheel.exe" are placed.
Lib > site-packages Various will be added. Difference between before and after execution. The right column is after. Light blue is a new item.
import pip You will be able to import pip with mayapy. It's a confirmation like "Oh, it's working".
With administrator privileges
mayapy get-pip.py
that's all.
This time I will "try to put it in", so the contents from here onwards will be on another occasion (?)
This is all you can do to pollute the environment. The formation of chaos is at your own risk! ←
Recommended Posts