Problems with "'sys' not defined"

  • Moloc

    Moloc - 2004-08-23

    I'm rather new to linux, i've just used for some months, so this may sound like I'm a complete idiot.

    I'm using a clean installation of Slackware 10.0 with everything exept the internationalising  thingies. The only thing I've installed yet is wxPython I have done exactly as instructed in the INSTALL.html document when I installed wxPython (using gtk2 and unicode). But when I try to start with python2.3 I get this message:

    "root@Comhem:/home/moloc/program/ABC-Linux-V.2.4.3# python2.3
    Traceback (most recent call last):
      File "", line 967, in ?
        run([""], abcpath)
      File "", line 959, in run
        app = ABCApp(0, params, single_instance_checker, abcpath)
      File "", line 928, in __init__
        wxApp.__init__(self, x)
      File "/usr/lib/python2.3/site-packages/wx/", line 5227, in __init__
      File "/usr/lib/python2.3/site-packages/wx/", line 4915, in _BootstrapApp
        return _core_.PyApp__BootstrapApp(*args, **kwargs)
      File "", line 932, in OnInit
        self.params, self.abcpath)
      File "", line 697, in __init__
        if (sys.platform == 'win32'):
    NameError: global name 'sys' is not defined"

    So, what do I do?

    • Imiro

      Imiro - 2004-12-06

      Ya i got the same msg :?

    • John L

      John L - 2004-12-24

      Hey all,
      The answers posted over here:

      To edit the file you gotta be logged in as root. Open in a text editor and add "import sys" minus the quotes as the very first line of code.

    • weary

      weary - 2005-07-13

      afterwards the program will start, but occasionally (for example when opening a dialog) you'll get the error again.
      Check which file is now causing the problem, and add the "import sys" line there as well


Log in to post a comment.