Menu

Welcome to Help

Help
cloudform
2011-03-18
2013-05-02
  • cloudform

    cloudform - 2011-03-18

    Welcome to Help

     
  • cloudform

    cloudform - 2011-03-21

    Note: The most up-to-date documentation will always be included in a pdf file with your download.  Reference there if you have problems, and then feel free to ask questions here.

     
  • Anonymous

    Anonymous - 2011-04-03

    Hello,
    I'm new to python and gnumeric. I'm using Ubuntu. I've installed PyWorkbooks according to your tutorial included in PyWorkbooksFiles-0-0-7.zip. Then I opened Gnumeric -> python console and typed:
    >>> import Gnumeric
    >>> from PyWorkbooks.GnWorkbook import GnWorkbook

    but then when I type: B = GnWorkbook()
    I get:
    Traceback (most recent call last):
    File "<string>", line 1, in <module>
    File "/usr/local/lib/python2.6/dist-packages/PyWorkbooks/GnWorkbook.py", line 187, in __init__
    self._update_workbooks_()
    File "/usr/local/lib/python2.6/dist-packages/PyWorkbooks/GnWorkbook.py", line 317, in _update_workbooks_
    sleep(.005)
    NameError: global name 'sleep' is not defined

    And I can't go any further. Could you please tell what is wrong?

    Thanks.

    Dias

     
  • cloudform

    cloudform - 2011-04-03

    Whoops!  I had a small bug in there where the code would fail if you didn't have numpy installed.  Should be fixed now, thanks for finding it!

     
  • cloudform

    cloudform - 2011-04-03

    You could either download the newest release, or just install numpy (I recommend numpy anyway :D)

     
  • Anonymous

    Anonymous - 2011-04-03

    I've now installed python-numpy ubuntu package, but typing B=GnWorkbook() gives the following:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/usr/local/lib/python2.6/dist-packages/PyWorkbooks/GnWorkbook.py", line 187, in __init__
        self._update_workbooks_()
      File "/usr/local/lib/python2.6/dist-packages/PyWorkbooks/GnWorkbook.py", line 326, in _update_workbooks_
        self.change_workbook(0, skipupdate = True)
      File "/usr/local/lib/python2.6/dist-packages/PyWorkbooks/GnWorkbook.py", line 304, in change_workbook
        self._update_sheets_()
      File "/usr/local/lib/python2.6/dist-packages/PyWorkbooks/GnWorkbook.py", line 239, in _update_sheets_
        self.sheets_library = sheet
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 0: ordinal not in range(128)

    What is wrong now?

     
  • cloudform

    cloudform - 2011-04-03

    That I have never seen, and I don't have the same problem on my system.  A couple of things:

    make sure you have the most recent version of Gnumeric.  Mine is 1.10.8.  You can find your version in the Synaptic Package Manager (go to system -> Administration -> Synaptic…)

    make sure you have the most recent version of the python plugin (gnumeric-plugings-extra).  If things still aren't working, maybe try and uninstall/reinstall everything (ick, I hope you don't have to do this.  Luckily it is pretty easy on ubuntu)

    Just to be sure, you are using python 2.6+ (the standard python install on ubuntu), correct?  You can also find that in the Package Manager.

    Are your sheets named "Sheet1", "Sheet2" etc, or are you using any special characters?

    This is a very strange problem.  You shouldn't be getting any characers like that from the "get_name_unquoted" function.  I only hope you somehow have an older version of Gnumeric…

    If you wanted to try some things that might help you learn, I could write out a couple of things that you could do to explore the problem (using the python debugger, etc).  If you are interested, add this to the top of the GnWorkbook.py file and re-run the setup.py script

    import sys, pdb
    def except_hook(exctype, value, traceback):
        if previous_except_hook:
            previous_except_hook(exctype, value, traceback)
        pdb.post_mortem(traceback)
           
    previous_except_hook = sys.excepthook
    sys.excepthook = except_hook
    

    That will let you play with the variables at that point and use the python-debugger (pdb module).  It would be great if you could help me to figure out the problem :D

     
  • Anonymous

    Anonymous - 2011-04-04

    Thanks!

    The problem was in the system language which was Russian. I've switched to English and it works now. Switching to English caused some mess with folder names, however, such as (Documents, Downloads, Trash, etc.). So it is not very convenient, but PyWorkbooks works now. :)

     
  • Anonymous

    Anonymous - 2011-04-04

    One more problem: when I open tutorial_external.gnumeric, I can't get the formulas working. Cells with py_run
    function return the following:

    unsupported operand type(s) for +: 'RangeRef' and 'int'

    What could be wrong there?

     
  • cloudform

    cloudform - 2011-04-04

    haha, Russian huh? I have no idea how to address that problem, if you ever have any thoughts/fixes, let me know.

    It looks like the code didn't convert the RangeRef (the gnumeric cell reference object) properly.  I'll take a look at it tonight.  The last time I tested it it worked fine, but I've released a few updates without testing the cells, so it's possible something broke.

    Just to make sure, the other cells work fine?  How about the py_macro cells?

    Hopefully this isn't also related to your language being Russian.  It probably isn't this time.

     
  • Anonymous

    Anonymous - 2011-04-05

    py_macro function seems to work fine. However, it  didn't work with the alice.txt (it couldn't read the file).

     
  • cloudform

    cloudform - 2011-04-07

    Hopefully things are going well.

    Sorry for not responding for a while.  I opened my gnumeric and I get the same error.  I'll debug it tonight.

     
  • Jacob Abrahams

    Jacob Abrahams - 2011-05-30

    Hi,
    When trying to do the following basic command from the demo,

    B = ExWorkbook()
    

    I get the following error:

    File "<stdin>" , line 1, in <module>
    File [...]ExWorkbook.py, line 149, in __init__()
        self._update_workbooks_()
    File[...]ExWorkbook.py, line 211 in _update_workbooks()
        self.current_workbook_name = self.xlApp.ActiveWorkbook.Name
    AttributeError: 'NoneType' object has no attribute 'Name'
    

    It'd be great if someone could help me with this, since I'm a little bit new to python.

    Thanks!

    Jacob

     
  • Anonymous

    Anonymous - 2011-05-31

    I've encountered that error before, there are three possibilities:

    1.  You don't have an excel document open.
    2.  The COM system is malfunctioning.  To reset the COM system close all open excell documents.  Also press cntrl+alt+del and end the process EXCEL.

    This should solve the problem.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.