Thank you @mercergeoinfo! In my case
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py
was missing urandom, but
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py
had urandom defined, and this was the only difference:
flengyel$ diff /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py \
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py
740a741,759
>
> if not _exists("urandom"):
> def urandom(n):
> """urandom(n) -> str
>
> Return a string of n random bytes suitable for cryptographic use.
>
> """
> try:
> _urandomfd = open("/dev/urandom", O_RDONLY)
> except (OSError, IOError):
> raise NotImplementedError("/dev/urandom (or equivalent) not found")
> try:
> bs = b""
> while n > len(bs):
> bs += read(_urandomfd, n - len(bs))
> finally:
> close(_urandomfd)
> return bs
Other plugins with this dependency could be installed after copying the version from /System/Library to /Library:
sudo cp /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py \
/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py
NOTE: the question or the answer or both should refer to Mac OS X.