UserPreferences

Installing / setting up python and MAYA libraries


The MAYA Python Libraries

The MAYA Python libraries enable you to treat u-forms as Python objects, and to get and set attributes and values of u-forms using single intuitive commands. How to do this will be described in the Python API documentation. First, you need to obtain and install the libraries.

Obtaining the MAYA Python libraries

Python API libraries for using the Information Commons are available from MAYA Design. MAYA Design makes these freely available to research collaborators, and is planning a public release as soon as is reasonably possible. In the meantime, if you want to propose a research collaboration, please contact [WWW]MAYA Design directly.

Installation instructions (so far)

The Python API for the VIA repository is shipped in the form of a compressed archive called VIAPythonAPI-0.1.tar.gz. Move this file to the directory which you want to use as the root of your API installation. (You will probably want to create a new directory for this purpose.) To uncompress the file type gunzip VIAPythonAPI-0.1.tar.gz at your command line. (This is your shell command line, not the python command line interpreter.) To unpack the individual files, type tar -xvf VIAPythonAPI-0.1.tar.

Suppose that you've installed the Python API library in the directory MAYAPython. (In the commands below, you should replace "MAYAPython" with the name of the directory you have actually used.) Also, suppose that the path down the directory tree to this location is given by (...prefix...). (You should be able to find this prefix using a command such as pwd, which means 'print working directory'.)

Using bash shell on cygwin, mac, or unix, type

 export PYTHONPATH=(...prefix...)/MAYAPython:$PYTHONPATH 

Using csh or tcsh shell on cygwin, mac, or unix, type

 setenv PYTHONPATH (...prefix...)/MAYAPython:$PYTHONPATH 

On Windows:

 set PYTHONPATH=C:(...prefix...)/MAYAPython;$PYTHONPATH 

All of these commands accomplish the same thing: they tell your Python installation to look in the new MAYAPython directory for Python components (as well as looking in the directories that were already referred to in your PYTHONPATH). Once you have done this once, you may well want to put the command into an initialization file (such as .bashrc or .cshrc in your home directory).

PATH variables enable a computer to find programs and components without being told exactly where they are stored on the filesystem every time you want to use them. Initialization files can be used to set these variables (and many others) once and for all, so that your personal settings are in effect every time you logon to the system. There should be a general introduction to this topic for non-techies, but apparently there isn't - only piecemeal instructions for specific operating systems. You will be able to find these if you search the internet, eg. for "Windows Path".

If you know of good links to help with this topic, please add them here - in the meantime, we hope that anyone who gets stuck setting their $PYTHONPATH will be able to ask a friend or system administrator for help.

Next step ...

Once you've got a working version of Python and the MAYA libraries, you can carry on to explore the Information Commons using the Python API.


Back to CiviumDocumentation