更改Maya的python安装 [英] Changing python installation for maya

查看:148
本文介绍了更改Maya的python安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我搜索了整个互联网. 1.我安装了64位的2014 Maya,我在c:\ python27.处安装了32位的python.如您所知,maya安装了自己的python并与之一起工作,我想对其进行更改并使其与我自己的python一起工作在C盘中.

I have searched around entire internet. 1. i have 64bit 2014 maya installed, i had 32bit python installed at c:\python27.. as you know maya installs its own python and works with that, i want to change it and make maya work with my own python that is installed in c drive.

我做了什么? 1.我确实更改了python,首先进行了安装,然后安装了64位版本,然后将cv2.pyd复制到其站点包中,还安装了matplotlib,scipy,pandas和numpy.我在pycharm中的代码工作正常,但maya给出了错误. 2.我更改了mayas python路径环境,但maya仍在使用自己安装的python而不指向我的.

What i did? 1. i did change the python, first unisntalled and and then installed 64bit version, i copied cv2.pyd to its site-packages and also installed matplotlib,scipy, pandas, numpy. my code in pycharm works just fine but maya gives error. 2. i changed mayas python path environment but still maya is using its own installed python not pointing to mine.

import sys

print sys.platform
print sys.version
print sys.prefix
print sys.path

在maya中告诉我,它使用的是python 2.7.3,而我要指出的是c驱动器中的python是2.7.8 ..什么?我如何使Maya与其他python一起工作

in maya tells me that its using python 2.7.3 whereas the python i want to point which is in c drive is 2.7.8.. anything ? how can i make maya work with the other python

推荐答案

Maya的Python(mayapy)版本是用Visual Studio 2010编译的,Python的2.7.x标准发行版是用VS2008编译的,两者不兼容.因此,如果您的软件包具有二进制依赖性,则在标准的64位Python安装中通过pip安装的软件包将不适用于Maya. (例如numpy,scipy,PIL,熊猫等)

Maya's version of Python (mayapy) is compiled with Visual Studio 2010, Python's 2.7.x standard distribution is compiled with VS2008, and the two aren't compatible. So packages you install via pip in your standard 64 bit Python install won't work with Maya if they have binary dependencies. (ex numpy, scipy, PIL, pandas, etc...)

要进行测试,请在脚本编辑器中打开python选项卡,然后执行以下操作:

To test, open a python tab in the script editor and do this:

import sys
print (sys.version)
# Result: 2.7.3 (default, Aug  1 2012, 16:33:56) [MSC v.1600 64 bit (AMD64)] #

这里重要的部分在方括号[MSC v.1600 64 bit (AMD64)]中. 如果您在安装的Python 2.7.x中执行相同的操作,则会发现它们不匹配.

The part that matters here is in square brackets [MSC v.1600 64 bit (AMD64)]. If you do the same in your installed version of Python 2.7.x, you'll see that they won't match.

您需要做的是使用Visual Studio 2010 + mayapy或

What you'll need to do is to compile these modules yourself using Visual Studio 2010 + either mayapy or a version of Python specifically built with VS2010. Either way it won't be easy in some cases.

I've made builds of packages I use compatible with Maya 2014-2015-2016 available here. Extract those packages anywhere Maya can see python packages and you should be able to work.

侧面说明:OSX上的Maya不受这些兼容性问题的困扰.

Side note: Maya on OSX doesn't suffer from these compatibility issues.

这篇关于更改Maya的python安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆