Installation of genesis fails

Bug #433434 reported by Jonas H
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Genesis Sync
Fix Released
Undecided
Unassigned

Bug Description

Genesis cannot be installed because configobj is not installed automatically (you should add this dependency to the setuptools dependencies so it's solved automatically).

Further, genesis can not be started because there's no /usr/share/genesis/genesis.spec.ini.

Original Exception:

$ genesis
Traceback (most recent call last):
  File "/usr/local/bin/genesis", line 31, in <module>
    genesis.main()
  File "/usr/local/lib/python2.6/dist-packages/Genesis/genesis.py", line 691, in main
    g = Genesis(si)
  File "/usr/local/lib/python2.6/dist-packages/Genesis/genesis.py", line 373, in __init__
    self.config = GenesisConfig()
  File "/usr/local/lib/python2.6/dist-packages/Genesis/genesis.py", line 221, in __init__
    self.config = configobj.ConfigObj(config_file, configspec=spec_file)
  File "/var/lib/python-support/python2.6/configobj.py", line 1272, in __init__
    self._load(infile, configspec)
  File "/var/lib/python-support/python2.6/configobj.py", line 1362, in _load
    self._handle_configspec(configspec)
  File "/var/lib/python-support/python2.6/configobj.py", line 1946, in _handle_configspec
    raise IOError('Reading configspec failed: %s' % e)
IOError: Reading configspec failed: Config file not found: "/usr/share/genesis/genesis.spec.ini".

(Both on Ubuntu Jaunty)

Related branches

Revision history for this message
Frederik Elwert (frederik-elwert) wrote :

Thanks for your report.

I guess you installed genesis via »python setup.py install«? If you are on Ubuntu Jaunty, it should generally be easier to install genesis via deb-Package.

Regarding the dependency resolution: I don’t use setuptools at all, but rather plain distutils. So depenencies are not resolved at all, you should get the information about required modules from the README file. Dependency resolution is done at the packaging level, and the genesis-sync.deb depends on python-configobj. So I don’t regard this as a bug.

So there remains the issue with genesis.spec.ini. This is caused by setup.py installing to /usr/local, while Genesis expects the data to be in sys.prefix, which is /usr in Ubuntu. So you could work around this by installing genesis from the .deb package or with »python setup.py install --prefix /usr«.

I currently don’t know of a way to reliably check for the prefix where Genesis is installed. If anyone has an idea how to add support for varying prefixes, I’ll add this. Otherwise, a hint regarding the --prefix should at least be added to the README.

Changed in genesis-sync:
status: New → Confirmed
Revision history for this message
Jonas H (jonash) wrote :

You could use absolute paths rather than relative paths in the constructor of the configobj.ConfigObj class in genesis.py. To be OS-independent, you could use the sys.prefix thing or something like that.

Revision history for this message
Frederik Elwert (frederik-elwert) wrote :

I am using absolute paths when launching an installed version of genesis (in contrast to launching it from the source directory). And I am using sys.prefix. But sys.prefix is always »/usr« on Ubuntu, while setup.py installs to »/usr/local« by default. I would have to figure out if genesis was installed to /usr/local, as setup.py does, or to /usr, as the debian package does, or to any other location.

Revision history for this message
davidcaste (davidcaste) wrote :

Hi!

I think I've managed this. By adding os.path.abspath(__file__) in genesis main script we're able to know the absolute path where the script has been invoked. If '/usr/local' is detected, we can use '/usr/local' has prefix instead of sys.prefix. I've done a very quick 'n' dirty patch to perform this check, and I'm sure it can be generalized for other locations in addition to '/usr' and '/usr/local'. But for now I'm satisfied because the 'setup.py' install script works again.

Please take a look to lp:~davidcaste/genesis-sync/0.4.2-fixes, rev 85. I've tested it with Ubuntu Karmic and Fedora 12, and everything seems all right.

About the python-configobj thing, as Frederik said it's not possible to automatically install that dependency through 'setup.py' script. However, I think it can be added some code to handle the situation where python-configobj is not available, and inform the user gracefully instead of an awful exception. I'll work on that, maybe it can be integrated in Genesis 0.4.3.

davidcaste (davidcaste)
Changed in genesis-sync:
status: Confirmed → Fix Committed
davidcaste (davidcaste)
Changed in genesis-sync:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.