This is truly bizarre. I've looked on google and cannot find anything
particularly helpful, although one person suggested that Python 2.0 and
2.1 were broken in this way (but hard to believe because that kind of
failure would have been trapped by trivial testing).
We had that "import site" error the other day when someone accidentally
used a mix of Python 2.2 and 2.3 code. So the problem was that they were
starting Python 2.2 but it was picking up Python 2.3 library code. So the
full error was something like:
D:\Python23\Lib\os.py:282: Warning: 'yield' will become a reserved
keyword in the future
'import site' failed; use -v for traceback
but you don't mention that first part so it's probably not quite the exact
same problem. However I just noticed the same "import site" problem when
running python on an old machine where my PYTHONPATH had some directory on
it which no longer existed, and python just hung, and when I managed to
ctrl-C it to free it, it gave that "import site" error.
So my guess (which might well be wrong) is that your PYTHONPATH has
something wrong with it, most likely that it has something on it which
means the wrong libraries are being picked up for the Python version you
are running.
Wayne
On Wed, 1 Sep 2004, PT Robinson wrote:
> hi. just trying to install the new release. i get an error on running the
> installCode:
>
> 'import site' failed; use -v for traceback
> Traceback (most recent call last):
> File "installCode.py", line 1, in ?
> import os
> ImportError: No module named os
>
> ???
>
> phil
>
|