problem with pydoc under python 2.6.1

  • Thread starter steve.ferg.bitbucket
  • Start date
S

steve.ferg.bitbucket

Has anybody encountered problems running pydoc with version 2.6.1?
I'm getting an error message that pydoc cannot import namedtuple
(details below).
(I'm running under 64-bit Windows Vista, although that probably is not
important.)

Here's my batch file, pydoc_test.bat:
=========================================================
@echo on
set pyver=python25
python c:\%pyver%\Lib\pydoc.py -w easygui

set pyver=python26
python c:\%pyver%\Lib\pydoc.py -w easygui
=========================================================

Here's what I get:
=========================================================
c:\pydev\easygui\v086>pydoc_test.bat

c:\pydev\easygui\v086>set pyver=python25

c:\pydev\easygui\v086>python c:\python25\Lib\pydoc.py -w easygui
wrote easygui.html

c:\pydev\easygui\v086>set pyver=python26

c:\pydev\easygui\v086>python c:\python26\Lib\pydoc.py -w easygui
Traceback (most recent call last):
File "c:\python26\Lib\pydoc.py", line 55, in <module>
import sys, imp, os, re, types, inspect, __builtin__, pkgutil
File "c:\python26\Lib\inspect.py", line 42, in <module>
from collections import namedtuple
ImportError: cannot import name namedtuple
========================================================

-- Steve Ferg
 
Y

yinoneh

Has anybody encountered problems running pydoc with version 2.6.1?
I'm getting an error message that pydoc cannot import namedtuple
(details below).
(I'm running under 64-bit Windows Vista, although that probably is not
important.)

Here's my batch file, pydoc_test.bat:
 =========================================================
 @echo on
 set pyver=python25
 python c:\%pyver%\Lib\pydoc.py -w easygui

 set pyver=python26
 python c:\%pyver%\Lib\pydoc.py -w easygui
 =========================================================

Here's what I get:
 =========================================================
 c:\pydev\easygui\v086>pydoc_test.bat

 c:\pydev\easygui\v086>set pyver=python25

 c:\pydev\easygui\v086>python c:\python25\Lib\pydoc.py -w easygui
 wrote easygui.html

 c:\pydev\easygui\v086>set pyver=python26

 c:\pydev\easygui\v086>python c:\python26\Lib\pydoc.py -w easygui
 Traceback (most recent call last):
   File "c:\python26\Lib\pydoc.py", line 55, in <module>
     import sys, imp, os, re, types, inspect, __builtin__, pkgutil
   File "c:\python26\Lib\inspect.py", line 42, in <module>
     from collections import namedtuple
 ImportError: cannot import name namedtuple
 ========================================================

-- Steve Ferg

the same for Python trunk (develompment version), on Ubuntu 8.04
I'm filing a bug report...
 
Y

Yinon Ehrlich

the same for Python trunk (develompment version), on Ubuntu 8.04
I'm filing a bug report...

sorry, it's OK.
My fault was using installed python to run development version's
library.
not sure about python26 for Windows...
Yinon
 
S

steve.ferg.bitbucket

Problem solved

Yinon's messages prompted me to take another look at my own code
(below). I realized that in the batch file I am looking for pydoc.py
in different locations for Python25 and Python26, but I am executing
python.exe without changing the path. Which means that I am executing
the same version of Python in both cases.

=========================================================
@echo on
set pyver=python25
python c:\%pyver%\Lib\pydoc.py -w easygui

set pyver=python26
python c:\%pyver%\Lib\pydoc.py -w easygui
=========================================================

The path was pointing to Python25, so when I ran against the 2.5
version of Pydoc it worked fine; when I ran against the 2.6 version of
Pydoc, I got an error.

I modified my batch file to also reset the PATH after pyver was set,
and then Pydoc worked fine in both cases.

Maybe somebody out there will find this an instructive mistake. My
thanks to Yinon; certainly for me his mistake was an instructive one.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top