I downloaded the program Zim to create a personal Wiki.
When I start the program, I get the following errors.
[moorero@moorero ~]$ zim Traceback (most recent call last): File "/usr/bin/zim", line 56, in <module> zim.main(argv) File "/usr/lib/python2.7/site-packages/zim/__init__.py", line 285, in main default = _get_default_or_only_notebook() File "/usr/lib/python2.7/site-packages/zim/__init__.py", line 136, in _get_default_or_only_notebook notebooks = get_notebook_list() File "/usr/lib/python2.7/site-packages/zim/notebook.py", line 317, in get_notebook_list return config_file('notebooks.list', klass=NotebookInfoList) File "/usr/lib/python2.7/site-packages/zim/config.py", line 199, in config_file return klass(file, default=default) File "/usr/lib/python2.7/site-packages/zim/notebook.py", line 118, in __init__ self.read() File "/usr/lib/python2.7/site-packages/zim/notebook.py", line 136, in read self.parse(lines) File "/usr/lib/python2.7/site-packages/zim/notebook.py", line 186, in parse config.parse(text[i:]) UnboundLocalError: local variable 'i' referenced before assignment [moorero@moorero ~]$
I tried the following and it worked fine.
sudo python2 /usr/bin/zim
So for a quick work around, I decide to start it with the following.
gksu python2 /usr/bin/zim
I get the same error starting it as gksu as I did with just zim.
I looked through the logs and didn't see anything corresponding with the time.
So I'm a bit confused since I can run the program with sudo.
Last edited by triumphguy (2011-06-03 23:17:38)
I am running community/zim 0.52-1 without problems.
There shouldn't be any because the 'binary' /usr/bin/zim is in reality a python script that starts with:
#!/usr/bin/python2 import sys import logging import os # Check if we run the correct python version try: version_info = sys.version_info assert version_info >= (2, 5) assert version_info < (3, 0) except: print >> sys.stderr, 'ERROR: zim needs python >= 2.5 (but < 3.0)' sys.exit(1)
so this should take care of the python code version.
Follow me on twitter: https://twitter.com/johnbina
I understand that the file is actually a python script. However, running zim at the prompt provides the error I mentioned in the original post. If I run it as a root user then it runs fine. I have checked the permissions and they are correct so I am perplexed as to why it is failing. If you look at the error, it fails at line 56 which is well past the python version test.
I've been playing with it some more. It seems the only way Zim will run and not get an error is if it is run with the sudo command. If I run it as root or a normal user it generates the error in the first post. I know this is a clue I just don't know enough to solve it.
Ok I have a solution.
Apparently the notebooks.list file was corrupt. After deleting it, Zim launches as expected. Since this is a config file, it wasn't removed when I removed and reinstalled Zim.