no attribute 'STC_CMD_CHARLEFTRECTEXTEND'

Help
Igor
2007-02-26
2013-04-26
  • Igor
    Igor
    2007-02-26

    Hi All,
    I am having trouble installing wxPython. When I try to run it, I get the following error:
    =========
    # ./drpython.pyw
    Traceback (most recent call last):
      File "./drpython.pyw", line 36, in ?
        drpython.main()
      File "/root/DrPython/drpython/drpython.py", line 3991, in main
        app = DrApp(0)
      File "/usr/lib64/python2.4/site-packages/wxPython/wx.py", line 1951, in __init__
        _wxStart(self.OnInit)
      File "/root/DrPython/drpython/drpython.py", line 3975, in OnInit
        self.frame = DrFrame(None, 101, "DrPython - Untitled 1")
      File "/root/DrPython/drpython/drpython.py", line 95, in __init__
        self.InitializeConstants()
      File "/root/DrPython/drpython/drpython.py", line 1076, in InitializeConstants
        self.STCCOMMANDLIST = drShortcuts.GetSTCCommandList()
      File "/root/DrPython/drpython/drShortcuts.py", line 219, in GetSTCCommandList
        return [wx.stc.STC_CMD_BACKTAB, wx.stc.STC_CMD_CANCEL,
    AttributeError: 'module' object has no attribute 'STC_CMD_CHARLEFTRECTEXTEND'
    =========
    # rpm -qa | grep wxPython
    wxPython-devel-2.6.3.2-2.fc6
    compat-wxPythonGTK2-2.4.2.4-12.fc6
    wxPython-2.6.3.2-2.fc6
    # python -V
    Python 2.4.4
    # uname -a
    Linux 2.6.19-1.2911.fc6 #1 SMP Sat Feb 10 15:16:31 EST 2007 x86_64 x86_64 x86_64 GNU/Linux
    ==========
    I guess, DrPython does not like the version of wxPython that I use. I imported wx in python session and, according to dir(), it has no STC_CMD_CHARLEFTRECTEXTEND field. Must I use an older version of wxPython or build it from source with some specific options enabled?
    I am running on Fedora Core 6, not sure which repository the wxPython rpms came from since I use many but judging by the name, it seems to be from Fedora itself.
    Thanks,
    Igor

     
    • Hello Igor,
      hm, the stc package is installed?
      else you would get already an error before; for example in wx.stc.STC_CMD_CHARLEFT.

      I suspect, this is an older scintilla control wrapped in wxPython.

      Does that make to much circumstances to try 2.8.1.1 for example?

       
      • Igor
        Igor
        2007-02-28

        Hi Franz,

        wx.stc.STC_CMD_CHARLEFT does exist.

        I removed wxPython rpms and built wxPython-2.8.1.1 from sources.
        When I try to run drpython.pyw, I get:
        ========================
        # ./drpython.pyw
        Traceback (most recent call last):
          File "./drpython.pyw", line 36, in ?
            drpython.main()
          File "/root/DrPython/drpython/drpython.py", line 3991, in main
            app = DrApp(0)
          File "/usr/lib64/python2.4/site-packages/wxPython/wx.py", line 1951, in __init__
            _wxStart(self.OnInit)
          File "/root/DrPython/drpython/drpython.py", line 3975, in OnInit
            self.frame = DrFrame(None, 101, "DrPython - Untitled 1")
          File "/root/DrPython/drpython/drpython.py", line 95, in __init__
            self.InitializeConstants()
          File "/root/DrPython/drpython/drpython.py", line 1076, in InitializeConstants
            self.STCCOMMANDLIST = drShortcuts.GetSTCCommandList()
          File "/root/DrPython/drpython/drShortcuts.py", line 219, in GetSTCCommandList
            return [wx.stc.STC_CMD_BACKTAB, wx.stc.STC_CMD_CANCEL,
        AttributeError: 'module' object has no attribute 'STC_CMD_CHARLEFTRECTEXTEND'

        ====================

        >>> import wx.stc
        >>> wx.stc.STC_CMD_CHARLEFT
        2304
        >>> wx.stc.STC_CMD_CHARLEFTRECTEXTEND
        Traceback (most recent call last):
          File "<stdin>", line 1, in ?
        AttributeError: 'module' object has no attribute 'STC_CMD_CHARLEFTRECTEXTEND'
        =====================

        So I guess the problem is not wxPython. I have the following scintilla rpms installed:
        #rpm -qa | grep scintilla
        PyQt-qscintilla-3.17-2.fc6
        qscintilla-1.7.1-1.fc6
        qscintilla-designer-1.7.1-1.fc6
        qscintilla-devel-1.7.1-1.fc6
        PyQt-qscintilla-devel-3.17-2.fc6

        Do I need to use something else?

        Thank you,
        Igor

         
    • Hello Igor,

      what I don't understand (sorry for my ignorance):

      wxPython-devel-2.6.3.2-2.fc6
      compat-wxPythonGTK2-2.4.2.4-12.fc6
      wxPython-2.6.3.2-2.fc6

      Do you have 2.4.24 ir 2.6.2.3?
      What do you get:
      python
      >import wx
      >wx.VERSION
      ?

      Is the demo working? Is the styledtextcontrol demo working?

      Have you tried to ask in the wxPython mailing list?
      Robin Dunn has an answer for you, I suppost! ;)

      Sorry for not helping you :(

      Cheers,

       
      • Igor
        Igor
        2007-02-28

        Hi Franz,

        > what I don't understand (sorry for my ignorance):
        >wxPython-devel-2.6.3.2-2.fc6 
        >compat-wxPythonGTK2-2.4.2.4-12.fc6 
        >wxPython-2.6.3.2-2.fc6 

        Good question: I thought it was 6.3.2-2 but it turned out that I was wrong. Apparently all those compat* packages shadowed wxPython-2.6.3.2:

        >>> wx.VERSION
        (2,4,2,4,'u')

        I uninstalled them and now DrPython seems to work.
        Thank you,
        Igor

         
    • Cool, All right! :)