I've seen this a few different times now and only within a virtualenv. My code will import some standard lib module which will import another which will eventually try to import urandom - which fails.
Here's a sample of the last few lines of one such traceback:
File "/usr/local/lib/python2.7/mimetools.py", line 6, in <module>
import tempfile
File "/usr/local/lib/python2.7/tempfile.py", line 34, in <module>
from random import Random as _Random
File "/usr/local/lib/python2.7/random.py", line 47, in <module>
from os import urandom as _urandom
ImportError: cannot import name urandom
It seems that as standard lib modules are trying to import this module, then it is a problem with python (as configured) rather than my code. But that it only happens within a virtualenv is really strange to me. Thoughts?