tags:

views:

253

answers:

2

When trying to use pydoc under Windows and python.org 2.6.4 I get the following error:

C:\>pydoc sys
'import site' failed; use -v for traceback
Traceback (most recent call last):
  File "C:\programs\Python26\Lib\pydoc.py", line 55, in ?
    import sys, imp, os, re, types, inspect, __builtin__, pkgutil
  File "C:\programs\Python26\Lib\os.py", line 758
    bs = b""
           ^
SyntaxError: invalid syntax

What could be wrong here?

A: 

how about setting your PATH

c:\> set PATH=C:\Python26\Lib;%PATH%
c:\> pydoc.py sys
ghostdog74
+1  A: 

Typical windows problem: I had a program installed lately which brought its own Python 2.4. This installation overwrote the Windows file handlers for python scripts, but did not appear on the PATH. So scripts started from the console ran in the old-version python, but calling "python" ran the 2.6 version.

Thx to Nadia for the first hint.

desolat