Re: peak/utils/addons import problem
PJ Eby <pje-Wh6+Hckhi6HFNGf7iClzIwC/[email protected]> Mon, 24 Oct 2011 18:06:10 -0400
| Newsgroups | gmane.comp.python.peak |
|---|---|
| Message-ID | <CALeMXf5c1xKyXNDh_6QWn25mgfJThiCr1gZSzxfB38URe3EOvg@mail.gmail.com> |
--===============0925256129== Content-Type: multipart/alternative; boundary=20cf307cff385f8b0b04b012a1ad --20cf307cff385f8b0b04b012a1ad Content-Type: text/plain; charset=ISO-8859-1 On Mon, Oct 24, 2011 at 5:07 PM, nicky van foreest <[email protected]>wrote: > Here is the output. It all looks well. > > nicky@chuck:~$ python > Python 2.7.2+ (default, Oct 4 2011, 20:06:09) > [GCC 4.6.1] on linux2 > Type "help", "copyright", "credits" or "license" for more information. > >>> import peak > >>> print peak.__path__ > ['/home/nicky/lib/python/Trellis-0.7a2-py2.7.egg/peak', > '/home/nicky/lib/python/Extremes-1.1.1-py2.7.egg/peak', > '/home/nicky/lib/python/Contextual-0.7a1.dev_r2695-py2.7.egg/peak', > '/home/nicky/lib/python/DecoratorTools-1.8-py2.7.egg/peak', > '/home/nicky/lib/python/AddOns-0.7-py2.7.egg/peak', > '/home/nicky/lib/python/SymbolType-1.0-py2.7.egg/peak'] > Indeed. So the question is why peak.util.__path__ only contains Extremes, and not AddOns or DecoratorTools. Okay, try this: import peak; import sys; print 'peak.util' in sys.modules If it's in sys.modules before you explicitly import it, it's probably an issue in the system python install, and you'll need to contact the Ubuntu folks. It might also be a good idea to list all your system packages that install stuff to the system Python, and to check what version of setuptools or Distribute is installed, in case the issue is in the one that's installed with the system Python. My guess is that if you use an isolated virtualenv that doesn't use the systemwide site-packages, this problem will go away. But that doesn't mean it shouldn't be fixed. (Note that even though you say there's no peak/util anywhere except in your ~lib/python, I strongly suspect that this has something to do with Debian and Ubuntu distributing a "peak.util" package that contains a whole bunch of peak.util stuff, with different versions of addons, decoratortools, etc. jammed together.) > > > > On 24 October 2011 22:49, PJ Eby <pje-Wh6+Hckhi6HFNGf7iClzIwC/[email protected]> wrote: > > > > > > On Mon, Oct 24, 2011 at 4:18 PM, nicky van foreest <[email protected] > > > > wrote: > >> > >> Thanks for your support. I guess this is the right sequence: > >> > >> nicky@chuck:~$ python > >> Python 2.7.2+ (default, Oct 4 2011, 20:06:09) > >> [GCC 4.6.1] on linux2 > >> Type "help", "copyright", "credits" or "license" for more information. > >> >>> import peak.util > >> >>> import pkg_resources > >> >>> pkg_resources.declare_namespace('peak.util') > >> >>> pkg_resources.require('AddOns') > >> [AddOns 0.7 (/home/nicky/lib/python/AddOns-0.7-py2.7.egg), > >> DecoratorTools 1.8 > >> (/home/nicky/lib/python/DecoratorTools-1.8-py2.7.egg)] > >> >>> print peak.util.__path__ > >> ['/home/nicky/lib/python/Extremes-1.1.1-py2.7.egg/peak/util'] > >> >>> import peak.util.addons > >> Traceback (most recent call last): > >> File "<stdin>", line 1, in <module> > >> ImportError: No module named addons > > > > Ugh. Oh. Actually, I just thought of something. At the beginning, > import > > peak and then print peak.__path__ too. I think I may've missed > something > > there. > _______________________________________________ > PEAK mailing list > [email protected] > http://www.eby-sarna.com/mailman/listinfo/peak > --20cf307cff385f8b0b04b012a1ad Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable <div class=3D"gmail_quote">On Mon, Oct 24, 2011 at 5:07 PM, nicky van foree= st <span dir=3D"ltr"><<a href=3D"mailto:[email protected]">vanforeest= @gmail.com</a>></span> wrote:<br><blockquote class=3D"gmail_quote" style= =3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"> Here is the output. It all looks well.<br> <div class=3D"im"><br> nicky@chuck:~$ python<br> Python 2.7.2+ (default, Oct =A04 2011, 20:06:09)<br> [GCC 4.6.1] on linux2<br> Type "help", "copyright", "credits" or "= license" for more information.<br> >>> import peak<br> </div>>>> print peak.__path__<br> ['/home/nicky/lib/python/Trellis-0.7a2-py2.7.egg/peak',<br> '/home/nicky/lib/python/Extremes-1.1.1-py2.7.egg/peak',<br> '/home/nicky/lib/python/Contextual-0.7a1.dev_r2695-py2.7.egg/peak',= <br> '/home/nicky/lib/python/DecoratorTools-1.8-py2.7.egg/peak',<br> '/home/nicky/lib/python/AddOns-0.7-py2.7.egg/peak',<br> '/home/nicky/lib/python/SymbolType-1.0-py2.7.egg/peak']<br></blockq= uote><div><br></div><div>Indeed. =A0So the question is why peak.util.__path= __ only contains Extremes, and not AddOns or DecoratorTools. =A0Okay, try t= his:</div> <div><br></div><div>import peak; import sys; print 'peak.util' in s= ys.modules</div><div><br></div><div>If it's in sys.modules before you e= xplicitly import it, it's probably an issue in the system python instal= l, and you'll need to contact the Ubuntu folks. =A0It might also be a g= ood idea to list all your system packages that install stuff to the system = Python, and to check what version of setuptools or Distribute is installed,= in case the issue is in the one that's installed with the system Pytho= n.</div> <div><br></div><div>My guess is that if you use an isolated virtualenv that= doesn't use the systemwide site-packages, this problem will go away. = =A0But that doesn't mean it shouldn't be fixed.</div><div><br></div= > <div>(Note that even though you say there's no peak/util anywhere excep= t in your ~lib/python, I strongly suspect that this has something to do wit= h Debian and Ubuntu distributing a "peak.util" package that conta= ins a whole bunch of peak.util stuff, with different versions of addons, de= coratortools, etc. jammed together.)</div> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex;"> <div><div></div><div class=3D"h5"><br> <br> <br> On 24 October 2011 22:49, PJ Eby <<a href=3D"mailto:[email protected]= m">pje-Wh6+Hckhi6HFNGf7iClzIwC/[email protected]</a>> wrote:<br> ><br> ><br> > On Mon, Oct 24, 2011 at 4:18 PM, nicky van foreest <<a href=3D"mail= to:[email protected]">[email protected]</a>><br> > wrote:<br> >><br> >> Thanks for your support. I guess this is the right sequence:<br> >><br> >> nicky@chuck:~$ python<br> >> Python 2.7.2+ (default, Oct =A04 2011, 20:06:09)<br> >> [GCC 4.6.1] on linux2<br> >> Type "help", "copyright", "credits" = or "license" for more information.<br> >> >>> import peak.util<br> >> >>> import pkg_resources<br> >> >>> pkg_resources.declare_namespace('peak.util')<= br> >> >>> pkg_resources.require('AddOns')<br> >> [AddOns 0.7 (/home/nicky/lib/python/AddOns-0.7-py2.7.egg),<br> >> DecoratorTools 1.8<br> >> (/home/nicky/lib/python/DecoratorTools-1.8-py2.7.egg)]<br> >> >>> print peak.util.__path__<br> >> ['/home/nicky/lib/python/Extremes-1.1.1-py2.7.egg/peak/util= 9;]<br> >> >>> import peak.util.addons<br> >> Traceback (most recent call last):<br> >> =A0File "<stdin>", line 1, in <module><br> >> ImportError: No module named addons<br> ><br> > Ugh. =A0Oh. =A0Actually, I just thought of something. =A0At the beginn= ing, import<br> > peak and then print peak.__path__ =A0too. =A0I think I may've miss= ed something<br> > there.<br> </div></div><div><div></div><div class=3D"h5">_____________________________= __________________<br> PEAK mailing list<br> <a href=3D"mailto:[email protected]">[email protected]</a><br> <a href=3D"http://www.eby-sarna.com/mailman/listinfo/peak" target=3D"_blank= ">http://www.eby-sarna.com/mailman/listinfo/peak</a><br> </div></div></blockquote></div><br> --20cf307cff385f8b0b04b012a1ad-- --===============0925256129== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ PEAK mailing list [email protected] http://www.eby-sarna.com/mailman/listinfo/peak --===============0925256129==--