Re: peak/utils/addons import problem

PJ Eby <pje-Wh6+Hckhi6HFNGf7iClzIwC/[email protected]> Mon, 24 Oct 2011 15:13:09 -0400
Newsgroups gmane.comp.python.peak
Message-ID <CALeMXf5M77q6i_6edUCP9iwdAbzQH4yxLJPeFo-OhCgaCSXU8Q@mail.gmail.com>
--===============0492048595==
Content-Type: multipart/alternative; boundary=20cf30025e06a3a2f804b0103656

--20cf30025e06a3a2f804b0103656
Content-Type: text/plain; charset=ISO-8859-1

On Mon, Oct 24, 2011 at 2:58 PM, nicky van foreest <[email protected]>wrote:

> > I notice that an Addons egg was in your easy-install.pth; is the egg file
> > actually there?
>
> Yes:
>
> nicky@chuck:~/lib/python$ ls
> AddOns-0.7-py2.7.egg/  Contextual-0.7a1.dev_r2695-py2.7.egg/
> DecoratorTools-1.8-py2.7.egg/  easy-install.pth
> Extremes-1.1.1-py2.7.egg/  pulp.py*  Pweave*  pysparse-1.0.1/  site.py
>  site.pyc  SymbolType-1.0-py2.7.egg/  tables@  tables-2.1.2/
> Trellis-0.7a2-py2.7.egg/
>
>  What happens if you start a fresh Python interpreter and
> > import peak.util.addons?
>
> I started ipython:
>
> In [1]: import peak.util.extremes
> peak.util.extremes
>
> it only autocompletes to peak.util.extremes. Pressing tab doesn't give
> any other option for peak.util than extremes.
>

I didn't say IPython, I said a Python interpreter.  I didn't ask about
autocompletion, I asked about importing.

This time, use regular Python, and actually try importing addons.

If you get an error, also do this:

>>> import peak.util
>>> print peak.util.__path__

My guess is that you now have a peak.util directory in your Ubuntu system
Python directory and it's not working properly with your current directory.
 If peak.util.__path__ doesn't list the AddOns egg, then try:

>>> import pkg_resources
>>> pkg_resources.require('AddOns')

Then see if peak.util.__path__ then includes the AddOns egg, and whether
"import peak.util.addons"  now works.

--20cf30025e06a3a2f804b0103656
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<div class=3D"gmail_quote">On Mon, Oct 24, 2011 at 2:58 PM, nicky van foree=
st <span dir=3D"ltr">&lt;<a href=3D"mailto:[email protected]">vanforeest=
@gmail.com</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=
=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class=3D"im">&gt; I notice that an Addons egg was in your easy-install=
.pth; is the egg file<br>
&gt; actually there?<br>
<br>
</div>Yes:<br>
<br>
nicky@chuck:~/lib/python$ ls<br>
AddOns-0.7-py2.7.egg/ =A0Contextual-0.7a1.dev_r2695-py2.7.egg/<br>
DecoratorTools-1.8-py2.7.egg/ =A0easy-install.pth<br>
Extremes-1.1.1-py2.7.egg/ =A0pulp.py* =A0Pweave* =A0pysparse-1.0.1/ =A0site=
.py<br>
=A0site.pyc =A0SymbolType-1.0-py2.7.egg/ =A0tables@ =A0tables-2.1.2/<br>
Trellis-0.7a2-py2.7.egg/<br>
<div class=3D"im"><br>
=A0What happens if you start a fresh Python interpreter and<br>
&gt; import peak.util.addons?<br>
<br>
</div>I started ipython:<br>
<br>
In [1]: import peak.util.extremes<br>
peak.util.extremes<br>
<br>
it only autocompletes to peak.util.extremes. Pressing tab doesn&#39;t give<=
br>
any other option for peak.util than extremes.<br></blockquote><div><br></di=
v>I didn&#39;t say IPython, I said a Python interpreter. =A0I didn&#39;t as=
k about autocompletion, I asked about importing.<br><br></div><div class=3D=
"gmail_quote">
This time, use regular Python, and actually try importing addons.</div><div=
 class=3D"gmail_quote"><br></div><div class=3D"gmail_quote">If you get an e=
rror, also do this:</div><div class=3D"gmail_quote"><br></div><div class=3D=
"gmail_quote">
&gt;&gt;&gt; import peak.util</div><div class=3D"gmail_quote">&gt;&gt;&gt; =
print peak.util.__path__</div><div class=3D"gmail_quote"><br></div><div cla=
ss=3D"gmail_quote">My guess is that you now have a peak.util directory in y=
our Ubuntu system Python directory and it&#39;s not working properly with y=
our current directory. =A0If peak.util.__path__ doesn&#39;t list the AddOns=
 egg, then try:</div>
<div class=3D"gmail_quote"><br></div><div class=3D"gmail_quote">&gt;&gt;&gt=
; import pkg_resources</div><div class=3D"gmail_quote">&gt;&gt;&gt; pkg_res=
ources.require(&#39;AddOns&#39;)</div><div class=3D"gmail_quote"><br></div>=
<div class=3D"gmail_quote">
Then see if peak.util.__path__ then includes the AddOns egg, and whether &q=
uot;import peak.util.addons&quot; =A0now works.</div><div class=3D"gmail_qu=
ote"><br></div>

--20cf30025e06a3a2f804b0103656--

--===============0492048595==
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
--===============0492048595==--