有什么方法可以在Maya中安装鼻子? [英] Is there any way to install nose in Maya?

查看:121
本文介绍了有什么方法可以在Maya中安装鼻子?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在家里使用Linux上的Autodesk Maya 2008,在Windows 7上使用Maya 2012.到目前为止,我的大部分努力都集中在前者上.我发现此线程,并设法使设置在那里在家工作.其要点是,为系统上安装的任何Python安装鼻子,然后创建一个py脚本,将该鼻子蛋添加到sys.path中,并加载到maya.standalone模块中,然后导入鼻子并运行它.然后,您可以通过Maya的Python版本(在maya目录结构中为mayapy)运行py脚本.

I'm using Autodesk Maya 2008 on Linux at home, and Maya 2012 on Windows 7 at work. Most of my efforts so far have been focused on the former. I found this thread, and managed to get the setup there working at home. The gist of it is that you install nose for whatever Python you have installed on your system, then create a py script that adds that nose egg to sys.path, and loads in the maya.standalone module, then imports nose and runs it. Then you run that py script through Maya's version of Python (mayapy in the maya directory structure).

我不确定在Maya 2008的嵌入式Python 2.5安装中是否运行鼻子的python 2.6安装是否值得关注.而且,这只是一个比较混乱的设置,我想为许多同事做这件事.最好将鼻梁安装到Maya 2008(Python 2.5)和2012(Python 2.6)中.

I'm unsure if running a Python 2.6 install of nose in Maya 2008's baked-in Python 2.5 installation is of concern. Moreover, it's just a more messy setup, and I'd like to do this for many coworkers. It would be nice to install nose right into Maya 2008 (Python 2.5) and 2012 (Python 2.6).

为此,我尝试下载鼻子并通过Maya的mayapy可执行文件进行安装:

To that end, I tried downloading nose and installing it via Maya's mayapy executable:

~sudo /autodesk/maya2008-x64/bin/mayapy setup.py build
running install
error: invalid Python installation: unable to open /autodesk/maya2008-x64/lib/python2.5/config/Makefile (No such file or directory)

那里没有配置文件夹.显然,这与缺少python-dev有关.我已经安装了,但是在系统版本的Python中.我不知道如何为Maya的Python安装它,或者甚至不可能安装它.是吗?玛雅人的Python版本是否太疯狂/一劳永逸,甚至不考虑这一点?

There's no config folder in there. Apparently this has to do with a missing python-dev. I have that installed, but out in the system version of Python. I don't know how to install it for Maya's Python, or if it's even possible. Is it? Is Maya's version of Python too crazy/one-off to even consider this?

推荐答案

由于nose是纯Python软件包,因此可以将其强制置于Maya内置Python的sys.path中.

Since nose is a pure-Python package, it is safe to force it onto the sys.path of Maya's built-in Python.

如果您将相同的nose安装与另一个2.X版本的Python一起使用,我认为可能发生的最坏情况是某些*.pyc崩溃.在这里,Maya 2011和2013在OS X和Linux上使用Python 2.6.4,因此我只需要确保将安装的版本添加到python2.6/site-packages目录中.

The worst that I believe could happen is some *.pyc thrashing if you use the same nose installation with another 2.X version of Python. Over here, Maya 2011 and 2013 use Python 2.6.4 on OS X and Linux, so I just make sure to add a version installed into a python2.6/site-packages directory.

这通常也适用于编译包,这使我们也可以为Maya构建PyQt4.

This generally holds for compiled packages as well, enabling us to build PyQt4 for Maya as well.

几个月来,我一直在毫无后果地进行此操作,甚至将其添加到正在运行的Maya GUI的sys.path中,以便针对该GUI编写测试!

I have been doing this without consequence for a few months now, even going so far as to add it to the sys.path of a running Maya GUI in order to write tests against the GUI!

这篇关于有什么方法可以在Maya中安装鼻子?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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