Mandrake 10.1 and Python 2.3.4

Discussion in 'Python' started by Joal Heagney, May 15, 2005.

  1. Joal Heagney

    Joal Heagney Guest

    Hi everyone. I've been getting this error message in python, and it's
    really driving me up the wall.


    [joal@localhost joal]$ python
    'import site' failed; use -v for traceback
    Python 2.3.4 (#1, Apr 18 2005, 19:03:06)
    [GCC 3.4.1] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>>


    Here's the relevant line when i run python in verbose mode:


    'import site' failed; traceback:
    Traceback (most recent call last):
    File "/usr/lib/python2.3/site.py", line 169, in ?
    sys.lib,
    AttributeError: 'module' object has no attribute 'lib'

    Is this a Mandrake or a Python mistake?
    And does anyone know how to fix it?

    I think this is the reason why I'm getting errors when it comes to
    importing other python packages.

    Joal
    Joal Heagney, May 15, 2005
    #1
    1. Advertising

  2. Joal Heagney

    Guest

    Hi Joal,
    I can only tell you that in my Linux Mandrake 10.1 (Community Edition),
    all is ok:
    Python 2.3.4 (#2, Aug 19 2004, 15:49:40)
    [GCC 3.4.1 (Mandrakelinux (Alpha 3.4.1-3mdk)] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import site
    >>> dir (site)

    ['_Helper', '_Printer', '__builtin__', '__builtins__', '__doc__',
    '__file__', '__name__', '_dirs_in_sys_path', '_init_pathinfo', '_test',
    'addpackage', 'addsitedir', 'encoding', 'here', 'makepath', 'os',
    'prefixes', 'sitedirs', 'sys']
    >>>

    This can't exclude that the error is in Mandrake's site (if you have
    the Official Edition), but I can't help you further because I am not
    an expert.
    Bye.
    , May 15, 2005
    #2
    1. Advertising

  3. Joal Heagney

    Terry Reedy Guest

    "Joal Heagney" <> wrote in message
    news:AsGhe.3663$...
    > 'import site' failed; traceback:
    > Traceback (most recent call last):
    > File "/usr/lib/python2.3/site.py", line 169, in ?
    > sys.lib,
    > AttributeError: 'module' object has no attribute 'lib'


    Right: the sys module usually has no .lib attribute that I know of

    >>> import sys; sys.lib

    Traceback (most recent call last):
    File "<stdin>", line 1, in ?
    AttributeError: 'module' object has no attribute 'lib'

    > Is this a Mandrake or a Python mistake?


    It is a site.py code mistake, but who wrote your copy of site.py?

    > And does anyone know how to fix it?


    Correct or remove the offending line (169)

    Terry J. Reedy
    Terry Reedy, May 15, 2005
    #3
  4. wrote:
    > Hi Joal,
    > I can only tell you that in my Linux Mandrake 10.1 (Community Edition),
    > all is ok:
    > Python 2.3.4 (#2, Aug 19 2004, 15:49:40)
    > [GCC 3.4.1 (Mandrakelinux (Alpha 3.4.1-3mdk)] on linux2
    > Type "help", "copyright", "credits" or "license" for more information.
    >
    >>>>import site
    >>>>dir (site)

    >
    > ['_Helper', '_Printer', '__builtin__', '__builtins__', '__doc__',
    > '__file__', '__name__', '_dirs_in_sys_path', '_init_pathinfo', '_test',
    > 'addpackage', 'addsitedir', 'encoding', 'here', 'makepath', 'os',
    > 'prefixes', 'sitedirs', 'sys']
    >
    > This can't exclude that the error is in Mandrake's site (if you have
    > the Official Edition), but I can't help you further because I am not
    > an expert.
    > Bye.
    >


    Likewise, 10.1 official (powerpack) is OK:

    [steve@StevesPC steve]$ cat /proc/version
    Linux version 2.6.8.1-12mdk () (gcc
    version 3.4.1 (Mandrakelinux (Alpha 3.4.1-3mdk)) #1 Fri Oct 1
    12:53:41 CEST 2004
    [steve@StevesPC steve]$ python
    Python 2.3.4 (#2, Aug 19 2004, 15:49:40)
    [GCC 3.4.1 (Mandrakelinux (Alpha 3.4.1-3mdk)] on linux2
    Type "help", "copyright", "credits" or "license" for more
    information.
    >>> import sys
    >>> dir(sys)

    ['__displayhook__', '__doc__', '__excepthook__', '__name__',
    '__stderr__', '__stdin__', '__stdout__', '_getframe',
    'api_version', 'arch', 'argv', 'builtin_module_names',
    'byteorder', 'call_tracing', 'callstats', 'copyright',
    'displayhook', 'exc_clear', 'exc_info', 'exc_type', 'excepthook',
    'exec_prefix', 'executable', 'exit', 'getcheckinterval',
    'getdefaultencoding', 'getdlopenflags', 'getfilesystemencoding',
    'getrecursionlimit', 'getrefcount', 'hexversion',
    'last_traceback', 'last_type', 'last_value', 'lib', 'maxint',
    'maxunicode', 'meta_path', 'modules', 'path', 'path_hooks',
    'path_importer_cache', 'platform', 'prefix', 'ps1', 'ps2',
    'setcheckinterval', 'setdlopenflags', 'setprofile',
    'setrecursionlimit', 'settrace', 'stderr', 'stdin', 'stdout',
    'version', 'version_info', 'warnoptions']
    >>>



    Perhaps you should uninstall and reinstall python, in case a file
    is corrupt.

    Steve
    Steve Horsley, May 15, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John

    Eclipse with Mandrake 9.1

    John, Sep 12, 2003, in forum: Java
    Replies:
    0
    Views:
    344
  2. MK

    Re: PyQT and Mandrake 9.1

    MK, Jul 1, 2003, in forum: Python
    Replies:
    5
    Views:
    301
    Jim Richardson
    Jul 3, 2003
  3. Wayne Pierce
    Replies:
    1
    Views:
    308
    Stuart D. Gathman
    Jul 17, 2003
  4. Barry Sprajc
    Replies:
    1
    Views:
    381
    Skip Montanaro
    Aug 3, 2003
  5. John Ridley

    Re: Mandrake 10.1 and Python 2.3.4

    John Ridley, May 16, 2005, in forum: Python
    Replies:
    1
    Views:
    317
    Joal Heagney
    May 16, 2005
Loading...

Share This Page