No module named os

Scott David Daniels Scott.Daniels at Acm.Org
Sun Oct 11 02:12:05 CEST 2009

smitty at wrote:
> 'import site' failed; use -v for traceback
> Traceback (most recent call last):
>   File "./", line 3, in <module>
>     import sys, os, glob
> ImportError: No module named os
> I'm trying to build a small program and I get the above error.
> I have had this error popup in the past while trying to build other
> programs. What can I do?
> Thanks

Go to a command line and type:
     $ python -v
which will tell you which includes are tried in which order.
If this doesn't make it painfully obvious, try:
     $ python -v -v
which will tell you what locations are being checked for files.

Normally you should:
   1) tell us python version and which OS (and OS version) you are using.
   2) include a pasted copy of exactly what did not work, along with the
      resulting output, and why you did not expect the output you got.

--Scott David Daniels
Scott.Daniels at Acm.Org

More information about the Python-list mailing list