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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You could either download the newest release, or just install numpy (I recommend numpy anyway :D)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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. :)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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).
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Welcome to Help
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.
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
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!
You could either download the newest release, or just install numpy (I recommend numpy anyway :D)
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?
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
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
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. :)
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?
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.
py_macro function seems to work fine. However, it didn't work with the alice.txt (it couldn't read the file).
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.
Hi,
When trying to do the following basic command from the demo,
I get the following error:
It'd be great if someone could help me with this, since I'm a little bit new to python.
Thanks!
Jacob
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.