Common Install Problems

SVN and updater URLs have changed

As of May 29, 2009, the mien svn and web repositories have moved. Existing mien svn working copies using urls from "armitage.cns.montana.edu" will now be orphaned. Check out new copies using "http://mien.cns.montana.edu/svn/mien".

Also, the automatic updater defaults to using a web repository at "cns.montana.edu" that is now deprecated. Instead, use "http://mien.msu.montana.edu/repository". You can change this setting by running the updater GUI (mien -a up), selecting File->preferences, and editing the "repository" field. While you are there, you probably want to switch the "Rev" field from "stable" to "dev". The stable releases tend to rather out of date, and not really that much more stable than the dev releases.

Resolving "mien: command not found" errors

This error means that the mien command is not in any of the directories specified in your system's PATH environment variable. If you know where the mien command is, this is easy to fix. Add the directory containing the command to your PATH, as described here. Alternately, you can create a symbolic link from the mien command to some place that is in your PATH already. For example, if you installed MIEN such that the mien command is at "/home/bob/mien/frontends/mien", you can either add "/home/bob/mien/frontends" to you PATH, or you can make a link such as ln -sf /home/bob/mien/frontends/mien /usr/bin (making this particular link requires that you have root privileges).

If you are sure the mien command is in your PATH, but you still get a "command not found", make sure the mien command has executable permissions. All the normal install methods should result in this script being executable, but you can make sure it is using chmod +x /home/bob/mien/frontends/mien (naturally, you should change the path name to the one that you are using on your system).

The mien command will always be in the subdirectory "frontends" of the mien package. Some of the package installers will also put a copy somewhere else on your system, such as "/usr/bin", but if you can't find that one, the one inside the mien package will work.

If you can run the mien command, but you get "python: command not found", you will need to ensure that Python is installed, and in your PATH. The mien command calls Python using "env", which means that it will get the same results that you get if you type "python" at shell prompt. If doing that doesn't get you the right version of Python, you will need to fix your Python install. Some help with this is given here.

Resolving "no module named..." errors from Python

Python uses the environment variable "PYTHONPATH" to figure out where to look for modules. If you are getting errors that say modules don't exist (such as mien, wx, or numpy), this could be because they are not installed, or because they are not in the PYTHONPATH. By default, the only directory in the PYTHONPATH is the site-packages directory for the running version of Python. You can figure out what directories are in the path using the Python interpretter:

matrim ~ > python Python 2.6 (trunk:66714:66715M, Oct 1 2008, 18:36:04) ... >>> import sys >>> sys.path ['', '/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/, '/Users/gic/mien' ... ]

If the directory containing MIEN isn't on this list you can modify your PYTHONPATH as described here.

Another thing to check is that the python you are running is actually the one you intended to install mien and its dependancies in. If you have more than one Python installed on your system, Python packages will usually be associated to only one of them (if they are different versions of Python, this is often required). When you type "python" you will activate the interpreter that is listed first in your path. Make sure it is the right one, and if it is not, modify your PATH. You can figure out where a program is getting run from by type which python.

Compiling Blocks

The "mienblocks" subversion repository contains a script named buildall.py, which will compile and install the binary components of all the included blocks. Each individual block which contains a binary component includes a bin subdirectory with the c source code and a Python distutils setup.py script. You can change directory into this bin directory and use python setup.py install --install-lib=.. to build and install the binary component. To do this, you will need a working build environment, as described below.

Note that if you installed from the web repository, the MIEN Update Manager, or by using apt-get on linux, you will have only the compiled .so for your architecture, and the bin directories and C source will not be included. Get the block code via subversion, or from a sourceforge download if you want to recompile the blocks.

To build extensions, you will need the Python and Numpy headers installed on your system. You will also need a C compiler which is compatible with the one that was used to build the Python that is installed on your system. If you built Python and Numpy from source, you should be ready to go. If you installed binary packages, you may need to do some extra work.

On Linux, Python is built with gcc, so install that. On some distributions, you may also need to install the development versions of the packages that provided Python and Numpy.

On Mac, the binary python installed by the MacPython package is built with the gcc contained in the Developer Tools (sometimes called "XCode Tools"). Make sure you install those and you are ready to go. If you install XCode, that will get you everything you need, all though you don't, in fact, actually need XCode.

On Windows systems compiling can be a real challenge. My advice would be not to do it. Get binary packages, use cygwin, or add a Linux partition to your machine. However, if you really want to modify or develop extensions on Windows it is possible, it will just take either some amount of money or a whole lot of time. The problem is that a) Windows doesn't have a C compiler by default, and b) The Windows binary of Python distributed by python.org was built with Microsoft Visual Studio, which is not free. You therefore have two choices: either install a free compiler (such as the mingw gcc compiler) and then build python, numpy, etc. from source using that compiler, or buy visual studio. MS Visual Studio .NET Pro 2003 is the version I use for building binary extensions for Windows.

PyODE is broken

Note that this bug only matters to the fibr extension block, and it is highly probable that you don't really want this block anyway. It is used for constructing physics models of legged robots. Unless you need that ability, just remove or disable fibr, and you won't need to worry about PyODE.

The fibr extension block depends on the Open Dynamics Engine (ode), and its Python wrapper (PyOde). As of pyode 1.2.0 there is a flaw in the stock distribution of PyODE that prevents it from working with the fibr module. This applies to the PyODE package that apt installs in response to the dependancy listed by the fibr module, as well as any PyODE that you may have built "out of the box".

The issue is that the PyODE wrapper (built by pyrex) doesn't wrap all the functions provided by the ODE core. In particular, the methods getAngle1, getAngle2, getAngleRate1 and getAngleRate2 of class UniversalJoint are not provided, and are needed by the fibr block. The workaround I use is to add the wrappers for these functions to the auto-generated C wrapper file ode_trimesh.c by hand. You can get my hacked up version: ode_trimesh.c, copy it into a source directory of PyODE, and then run python setup.py install, thus building the more complete wrapper.

 

Last edit: 05/29/09

Index