[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

os.path: ImportError: cannot import name realpath



Hallo Mailinglist,

I never used Python before (just perl) :-( .
I got problems to get the python Programm "archmage" [1] runnig under woody.
I'm not sure, but I think the os.path "library" is missing or not correctly installed
(Point 3. says it is installed).
Were is the error, which additional (deb) package do I have to install to get it working?


Thanks in advance.
Regards and a happy New Year's Eve
Emal



[1]: It's a programm to convert "chm" (Microsoft Compiled HTML files) to html
See Freshmeat for more details:
http://freshmeat.net/projects/archmage/?topic_id=234,849,867


1. Error output of arCHMage:
============================
emal@buster:~$ ls -l test.chm
-rwxr-xr-x    1 emal     family       738K 2003-12-26 19:04 test.chm

emal@buster:~$ archmage test.chm /tmp
Traceback (most recent call last):
  File "/usr/bin/archmage", line 7, in ?
    from CHM import *
  File "/usr/lib/python2.1/site-packages/CHM.py", line 2, in ?
    from os.path import isfile,isdir,exists,dirname,realpath,getsize,walk
ImportError: cannot import name realpath


2. CHM.py:
==========
emal@buster:~$ less /usr/lib/python2.1/site-packages/CHM.py
from os import mkdir,makedirs,chdir,getcwd,listdir
from os.path import isfile,isdir,exists,dirname,realpath,getsize,walk
from re import match,escape,search,sub
from shutil import copytree
from HTMLParser import HTMLParser,HTMLParseError,piclose
from BaseHTTPServer import HTTPServer,BaseHTTPRequestHandler
from urllib import unquote
from time import sleep
from mimetypes import guess_type

import chmlib
...


3. I'm using woody python2.1:
===============================
emal@buster:~$ ls -l `which python`
lrwxrwxrwx    1 root     root            9 2002-12-17 14:10 /usr/bin/python -> python2.1

emal@buster:~$ python -v
# /usr/lib/python2.1/site.pyc matches /usr/lib/python2.1/site.py
import site # precompiled from /usr/lib/python2.1/site.pyc
# /usr/lib/python2.1/os.pyc matches /usr/lib/python2.1/os.py
import os # precompiled from /usr/lib/python2.1/os.pyc
import posix # builtin
# /usr/lib/python2.1/posixpath.pyc matches /usr/lib/python2.1/posixpath.py
import posixpath # precompiled from /usr/lib/python2.1/posixpath.pyc
# /usr/lib/python2.1/stat.pyc matches /usr/lib/python2.1/stat.py
import stat # precompiled from /usr/lib/python2.1/stat.pyc
# /usr/lib/python2.1/UserDict.pyc matches /usr/lib/python2.1/UserDict.py
import UserDict # precompiled from /usr/lib/python2.1/UserDict.pyc
Python 2.1.3 (#1, Sep  7 2002, 15:29:56)
[GCC 2.95.4 20011002 (Debian prerelease)] on linux2
Type "copyright", "credits" or "license" for more information.
import readline # dynamically loaded from /usr/lib/python2.1/lib-dynload/readline.so
>>>
<CTRL-D>
# clear __builtin__._
# clear sys.path
# clear sys.argv
# clear sys.ps1
# clear sys.ps2
# clear sys.exitfunc
# clear sys.exc_type
# clear sys.exc_value
# clear sys.exc_traceback
# clear sys.last_type
# clear sys.last_value
# clear sys.last_traceback
# restore sys.stdin
# restore sys.stdout
# restore sys.stderr
# cleanup __main__
# cleanup[1] readline
# cleanup[1] exceptions
# cleanup[1] posix
# cleanup[1] site
# cleanup[1] signal
# cleanup[2] os.path
# cleanup[2] os
# cleanup[2] UserDict
# cleanup[2] posixpath
# cleanup[2] stat
# cleanup sys
# cleanup __builtin__
# cleanup ints: 2 unfreed ints in 1 out of 3 blocks
# cleanup floats



4. arCHMage is used the correct way:
=====================================
The manual says:
$:more README
     arCHMage is an extensible reader and decompiler for files in the CHM format.
     This is the format used by Microsoft HTML Help, and is also known as Compiled HTML.
     arCHMage is based on chmlib by Jed Wing (http://66.93.236.84/~jedwin/projects/chmlib/).

     There is three ways to use arCHMage package now:
     1) Extract .chm to directory(directory will be created):
     archmage <chmfile> <directory>
     ...






Reply to: