Is there any way to install nose in Maya?

2024/10/14 10:42:23

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).

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).

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)

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?

Answer

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

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.

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

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!

https://en.xdnf.cn/q/117969.html

Related Q&A

Basic python socket server application doesnt result in expected output

Im trying to write a basic server / client application in python, where the clients sends the numbers 1-15 to the server, and the server prints it on the server side console. Code for client:import soc…

creating dictionaries to list order of ranking

I have a list of people and who controls who but I need to combine them all and form several sentences to compute which person control a list of people.The employee order comes from a txt file:

Python: How to use MFdataset in netCDF4

I am trying to read multiple NetCDF files and my code returns the error:ValueError: MFNetCDF4 only works with NETCDF3_* and NETCDF4_CLASSIC formatted files, not NETCDF4. I looked up the documentation a…

Pyspark: Concat function generated columns into new dataframe

I have a pyspark dataframe (df) with n cols, I would like to generate another df of n cols, where each column records the percentage difference b/w consecutive rows in the corresponding, original df co…

Mysql.connector to access remote database in local network Python 3

I used mysql.connector python library to make changes to my local SQL server databases using: from __future__ import print_function import mysql.connector as kkcnx = kk.connect(user=root, password=pass…

concurrent.futures not parallelizing write

I have a list dataframe_chunk which contains chunks of a very large pandas dataframe.I would like to write every single chunk into a different csv, and to do so in parallel. However, I see the files be…

Querying SQLite database file in Google Colab

print (Files in Drive:)!ls drive/AIFiles in Drive:database.sqlite Reviews.csv Untitled0.ipynb fine_food_reviews.ipynb Titanic.csvWhen I run the above code in Google Colab, clearly my sqlite file is pre…

AttributeError: function object has no attribute self

I have a gui file and I designed it with qtdesigner, and there are another py file. I tried to changing button name or tried to add item in listwidget but I didnt make that things. I got an error messa…

Find file with largest number in filename in each sub-directory with python?

I am trying to find the file with the largest number in the filename in each subdirectory. This is so I can acomplish opening the most recent file in each subdirectory. Each file will follow the namin…

Selenium Python - selecting from a list on the web with no stored/embedded options

Im very new to Python so forgive me if this isnt completely comprehensible. Im trying to select from a combobox in a webpage. All the examples Ive seen online are choosing from a list where the options…