namespace packages broken in ubuntu with zc.buildout 1.5?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

namespace packages broken in ubuntu with zc.buildout 1.5?

Wichert Akkerman
I am running into something very odd on an Ubuntu 11.10 system: it looks
like namespace packages are entirely broken there. Here is a pdb session
to demonstrate:

(Pdb) import repoze
(Pdb) repoze
<module 'repoze' from
'/home/wichert/lib/buildout/eggs/repoze.formapi-0.4.2-py2.7.egg/repoze/__init__.pyc'>
(Pdb) repoze.__path__
['/home/wichert/lib/buildout/eggs/repoze.sphinx.autointerface-0.6.2-py2.7.egg/repoze',
'/home/wichert/lib/buildout/eggs/repoze.formapi-0.4.2-py2.7.egg/repoze']

So at this point I can import the repoze namespace packages, which is
defined by both repoze.sphinx.autointerface and repoze.formapi. Now I
try to import repoze.sphinx.autointerface:

(Pdb) import repoze.sphinx.autointerface
*** ImportError: No module named autointerface

That is unexpected since we saw the repoze.sphinx.autointerface egg was
found earlier. So lets look at repoze.sphinx:

(Pdb) repoze.sphinx
<module 'repoze.sphinx' from
'/usr/lib/pymodules/python2.7/sphinx/__init__.pyc'>

I did not see that coming at all: how can a system sphinx package that
is not inside the repoze namespace suddenly appear there? This is
especially odd since buildout hooked me up with a sphinx package in the
buildout itself:

(Pdb) import sphinx
<module 'sphinx' from
'/home/wichert/lib/buildout/eggs/Sphinx-1.0.1-py2.7.egg/sphinx/__init__.pyc'>

I am not sure who is responsible for this behaviour or how to debug
this. Does anyone have any useful hints?

Wichert.

_______________________________________________
Distutils-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/distutils-sig
Reply | Threaded
Open this post in threaded view
|

Re: namespace packages broken in ubuntu with zc.buildout 1.5?

Jim Fulton
See the posts from Felix Schwarz here a few days ago.  It looks like
he ran into and
debugged the same issue.  I haven't had a chance to wade into it. (I can't
say I'm looking forward to it.)

I'll try to get up to speed on this this weekend.

Jim

On Thu, Apr 12, 2012 at 6:16 AM, Wichert Akkerman <[hidden email]> wrote:

> I am running into something very odd on an Ubuntu 11.10 system: it looks
> like namespace packages are entirely broken there. Here is a pdb session to
> demonstrate:
>
> (Pdb) import repoze
> (Pdb) repoze
> <module 'repoze' from
> '/home/wichert/lib/buildout/eggs/repoze.formapi-0.4.2-py2.7.egg/repoze/__init__.pyc'>
> (Pdb) repoze.__path__
> ['/home/wichert/lib/buildout/eggs/repoze.sphinx.autointerface-0.6.2-py2.7.egg/repoze',
> '/home/wichert/lib/buildout/eggs/repoze.formapi-0.4.2-py2.7.egg/repoze']
>
> So at this point I can import the repoze namespace packages, which is
> defined by both repoze.sphinx.autointerface and repoze.formapi. Now I try to
> import repoze.sphinx.autointerface:
>
> (Pdb) import repoze.sphinx.autointerface
> *** ImportError: No module named autointerface
>
> That is unexpected since we saw the repoze.sphinx.autointerface egg was
> found earlier. So lets look at repoze.sphinx:
>
> (Pdb) repoze.sphinx
> <module 'repoze.sphinx' from
> '/usr/lib/pymodules/python2.7/sphinx/__init__.pyc'>
>
> I did not see that coming at all: how can a system sphinx package that is
> not inside the repoze namespace suddenly appear there? This is especially
> odd since buildout hooked me up with a sphinx package in the buildout
> itself:
>
> (Pdb) import sphinx
> <module 'sphinx' from
> '/home/wichert/lib/buildout/eggs/Sphinx-1.0.1-py2.7.egg/sphinx/__init__.pyc'>
>
> I am not sure who is responsible for this behaviour or how to debug this.
> Does anyone have any useful hints?
>
> Wichert.
>
> _______________________________________________
> Distutils-SIG maillist  -  [hidden email]
> http://mail.python.org/mailman/listinfo/distutils-sig



--
Jim Fulton
http://www.linkedin.com/in/jimfulton
Jerky is better than bacon! http://www.dublinstore.com/
_______________________________________________
Distutils-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/distutils-sig
Reply | Threaded
Open this post in threaded view
|

Re: namespace packages broken in ubuntu with zc.buildout 1.5?

Marius Gedminas-2
In reply to this post by Wichert Akkerman
On Thu, Apr 12, 2012 at 12:16:22PM +0200, Wichert Akkerman wrote:
> I am running into something very odd on an Ubuntu 11.10 system: it
> looks like namespace packages are entirely broken there.

Interesting.  As a data point: I use zc.buildout 1.5.2 on Ubuntu 11.10.
I haven't encountered any namespace issues yet.

> Here is a
> pdb session to demonstrate:
>
> (Pdb) import repoze
> (Pdb) repoze
> <module 'repoze' from '/home/wichert/lib/buildout/eggs/repoze.formapi-0.4.2-py2.7.egg/repoze/__init__.pyc'>
> (Pdb) repoze.__path__
> ['/home/wichert/lib/buildout/eggs/repoze.sphinx.autointerface-0.6.2-py2.7.egg/repoze', '/home/wichert/lib/buildout/eggs/repoze.formapi-0.4.2-py2.7.egg/repoze']
>
> So at this point I can import the repoze namespace packages, which
> is defined by both repoze.sphinx.autointerface and repoze.formapi.
> Now I try to import repoze.sphinx.autointerface:
>
> (Pdb) import repoze.sphinx.autointerface
> *** ImportError: No module named autointerface
>
> That is unexpected since we saw the repoze.sphinx.autointerface egg
> was found earlier. So lets look at repoze.sphinx:
>
> (Pdb) repoze.sphinx
> <module 'repoze.sphinx' from
> '/usr/lib/pymodules/python2.7/sphinx/__init__.pyc'>
Do you have a small sample buildout.cfg so that I could try to reproduce
this?  This one worked for me:

    $ cat buildout.cfg
    [buildout]
    parts = wtf

    [wtf]
    recipe = z3c.recipe.scripts
    # recipe = zc.recipe.egg also worked fine
    eggs =
        Sphinx
        repoze.formapi
        repoze.sphinx.autointerface
    interpreter = python

    $ python bootstrap.py
    $ bin/python
    Python 2.7.2+ (default, Oct  4 2011, 20:03:08)
    >>> import repoze
    >>> repoze.__path__
    ['/home/mg/.buildout/eggs/repoze.formapi-0.5.0-py2.7.egg/repoze', '/home/mg/.buildout/eggs/repoze.sphinx.autointerface-0.6.2-py2.7.egg/repoze']
    >>> import repoze.sphinx.autointerface
    >>> repoze.sphinx
    <module 'repoze.sphinx' from '/home/mg/.buildout/eggs/repoze.sphinx.autointerface-0.6.2-py2.7.egg/repoze/sphinx/__init__.pyc'>

even though I also have sphinx installed into my dist-packages
(/usr/lib/pymodules/python2.7/sphinx/__init__.pyc exists).

> I did not see that coming at all: how can a system sphinx package
> that is not inside the repoze namespace suddenly appear there? This
> is especially odd since buildout hooked me up with a sphinx package
> in the buildout itself:
>
> (Pdb) import sphinx
> <module 'sphinx' from '/home/wichert/lib/buildout/eggs/Sphinx-1.0.1-py2.7.egg/sphinx/__init__.pyc'>
>
> I am not sure who is responsible for this behaviour or how to debug
> this. Does anyone have any useful hints?
Not really.  I'm afraid when I encounter buildout issues, I'm in the
"aaargh no time for yak shaving NOW" mode, so I tend to intuitively
twiddle some knobs like 'include-site-packages = false' for 10-15
minutes until it starts working.

Marius Gedminas
--
Hanlon's Razor:
        Never attribute to malice that which is adequately explained
        by stupidity.

_______________________________________________
Distutils-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/distutils-sig

signature.asc (197 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: namespace packages broken in ubuntu with zc.buildout 1.5?

Barry Warsaw
On Apr 12, 2012, at 05:51 PM, Marius Gedminas wrote:

>Interesting.  As a data point: I use zc.buildout 1.5.2 on Ubuntu 11.10.
>I haven't encountered any namespace issues yet.

I haven't seen any issues with zc.buildout 1.5.2 on Ubuntu 12.04 either.

Cheers,
-Barry

_______________________________________________
Distutils-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/distutils-sig

signature.asc (853 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: namespace packages broken in ubuntu with zc.buildout 1.5?

Felix Schwarz-5
In reply to this post by Jim Fulton
Hey,

Am 12.04.2012 15:38, schrieb Jim Fulton:
> See the posts from Felix Schwarz here a few days ago.  It looks like
> he ran into and debugged the same issue.  I haven't had a chance to wade into it. (I can't
> say I'm looking forward to it.)

I think my last two emails contain a detailed explaination + workaround patch.
If you have any questions, don't hesitate to ask - by now I think I have quite
thorough understanding of the issue...

fs

_______________________________________________
Distutils-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/distutils-sig
Reply | Threaded
Open this post in threaded view
|

Re: namespace packages broken in ubuntu with zc.buildout 1.5?

Wichert Akkerman
In reply to this post by Wichert Akkerman
Let me try to answer some questions that came up:

- the buildout I used to reproduce this is this one:
https://github.com/euphorie/Euphorie
- this was using buildout 1.5.2



On 2012-4-12 12:16, Wichert Akkerman wrote:

> I am running into something very odd on an Ubuntu 11.10 system: it looks
> like namespace packages are entirely broken there. Here is a pdb session
> to demonstrate:
>
> (Pdb) import repoze
> (Pdb) repoze
> <module 'repoze' from
> '/home/wichert/lib/buildout/eggs/repoze.formapi-0.4.2-py2.7.egg/repoze/__init__.pyc'>
>
> (Pdb) repoze.__path__
> ['/home/wichert/lib/buildout/eggs/repoze.sphinx.autointerface-0.6.2-py2.7.egg/repoze',
> '/home/wichert/lib/buildout/eggs/repoze.formapi-0.4.2-py2.7.egg/repoze']
>
> So at this point I can import the repoze namespace packages, which is
> defined by both repoze.sphinx.autointerface and repoze.formapi. Now I
> try to import repoze.sphinx.autointerface:
>
> (Pdb) import repoze.sphinx.autointerface
> *** ImportError: No module named autointerface
>
> That is unexpected since we saw the repoze.sphinx.autointerface egg was
> found earlier. So lets look at repoze.sphinx:
>
> (Pdb) repoze.sphinx
> <module 'repoze.sphinx' from
> '/usr/lib/pymodules/python2.7/sphinx/__init__.pyc'>
>
> I did not see that coming at all: how can a system sphinx package that
> is not inside the repoze namespace suddenly appear there? This is
> especially odd since buildout hooked me up with a sphinx package in the
> buildout itself:
>
> (Pdb) import sphinx
> <module 'sphinx' from
> '/home/wichert/lib/buildout/eggs/Sphinx-1.0.1-py2.7.egg/sphinx/__init__.pyc'>
>
>
> I am not sure who is responsible for this behaviour or how to debug
> this. Does anyone have any useful hints?
>
> Wichert.
>


--
Wichert Akkerman <[hidden email]>   It is simple to make things.
http://www.wiggy.net/                  It is hard to make things simple.
_______________________________________________
Distutils-SIG maillist  -  [hidden email]
http://mail.python.org/mailman/listinfo/distutils-sig