Problems with "'sys' not defined"

Moloc
2004-08-23
2013-04-16
  • 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 2.5.2.7. 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 abc.py with python2.3 I get this message:

    "root@Comhem:/home/moloc/program/ABC-Linux-V.2.4.3# python2.3 abc.py
    Traceback (most recent call last):
      File "abc.py", line 967, in ?
        run([""], abcpath)
      File "abc.py", line 959, in run
        app = ABCApp(0, params, single_instance_checker, abcpath)
      File "abc.py", line 928, in __init__
        wxApp.__init__(self, x)
      File "/usr/lib/python2.3/site-packages/wx/_core.py", line 5227, in __init__
        self._BootstrapApp()
      File "/usr/lib/python2.3/site-packages/wx/_core.py", line 4915, in _BootstrapApp
        return _core_.PyApp__BootstrapApp(*args, **kwargs)
      File "abc.py", line 932, in OnInit
        self.params, self.abcpath)
      File "abc.py", 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:

      http://sourceforge.net/forum/forum.php?thread_id=1183509&forum_id=399114

      To edit the file you gotta be logged in as root. Open ABC.py 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.