I'm running an embedded Python interpreter in Obj-C. I can run Python scripts just fine, but when I try to import certain standard modules, I get ImportError: No module named random, for instance.
However, I can import certain other modules. My investigations has given me this list so far:
Can:

import sys
import math
import datetime
import time

Can't:

import random
import re
import cmath
import numbers
import string

This is from a python file enclosed in a package, imported via PyImport_Import ('package.module'). There is one extension module loaded via Py_InitModule.
This is on Python 2.7.0 - is there any reason some of these modules are available and others not?
Thomas K set me on the right track, even though the problem was the completely opposite.
My Python setup was lacking the standard Python library - the part written in Python (usually distributed through /Library, /Lib or /pylib in the distribution. Once those files were added to my application, all of it imported fine.
So, the link between the importable and non-importable modules above were that the importable were written as Python extensions in C, whereas the non-importable are written in pure Python.
Can't import specific modules in embedded Python