problem with namespace package

Bug #1388477 reported by Christophe Combelles
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenERP buildout recipe
Fix Committed
Undecided
Unassigned

Bug Description

How to reproduce:

create a typical Odoo buildout, then

$ virtualenv pyenv
$ source ./bad/bin/activate
$ pip install anybox.paster.odoo
$ python bootstrap.py
$ ./bin/buildout
$ ./bin/start_odoo
Traceback (most recent call last):
  File "./bin/start_odoo", line 51, in <module>
    import anybox.recipe.openerp.runtime.start_openerp
ImportError: No module named recipe.openerp.runtime.start_openerp

Not sure where the problem really lies. Maybe a missing namespace_packages in setup.py:
   namespace_packages=['anybox', 'anybox.recipe'],
..or any other weird thing in pip or setuptools.

Revision history for this message
Georges Racinet (gracinet) wrote :

Yes it looks as if the anybox.paster.odoo that's in the virtualenv stealed the namespace, and I don't know if that can be solved easily (not the first time I hear about this, I think).

On the other hand, it's always been said (and I hope stated very clearly in the documentation) that the virtualenvs in which the buildout will be bootstrapped/run must be completeley empty (not even setuptools/pip). I agree this might look heavy-handed, but on the other hand you can reuse such a virtualenv for all your buildouts.

If that's not clear enough in the documentation, then please update the documentation.
If you have are willing to spend the hours finding a fix for this, that can be validated with different situations, of course I'll welcome it and update the guidelines -- but it should then work for a lot of setups, and that's opening a can of worms, I fear it'll be more complicated in the end

Revision history for this message
Georges Racinet (gracinet) wrote :

Still have a few doubts about your extract, hope I undestood it right, feel free to reopen if I got it wrong

Changed in anybox.recipe.openerp:
status: New → Won't Fix
Revision history for this message
Christophe Combelles (ccomb) wrote :

I confirm that adding the namespace declaration fixes things in a number of cases. For instance this one:

virtualenv sandbox
source sandbox/bin/activate
pip install anybox.paster.odoo
pip install anybox.recipe.openerp
pip
Traceback (most recent call last):
  (...)
  File "<string>", line 1, in <module>
KeyError: 'anybox'

I believe it won't hurt to add the declaration and can also help with the other issue in this bug.
Reopening until we see if we can reproduce or not after 1.8.6

Changed in anybox.recipe.openerp:
status: Won't Fix → Fix Committed
Revision history for this message
Georges Racinet (gracinet) wrote :

Yes, reproduction ourside of the buildout landscape is much appreciated and changes my position on whether investigating is worth the effort.

Thanks for the fix, then, but what about "in a number of cases" and what is "the other issue" ?

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.