[IPython-user] Install problem

Fernando Perez fperez.net@gmail....
Sat Aug 11 13:50:50 CDT 2007


Hi,

On 8/10/07, rbiswas@uwm.edu <rbiswas@uwm.edu> wrote:
> Sir,
> I have subscribed to ipython users community as you said. I will be regular on
> that. I am attaching the output of the commands you hav said, for your quick
> reference.

OK, then you'll continue to receive these messages from the list.

For reference (full message at the end), I asked the OP to put

import os,sys,pprint;
print '*** Module path:',os.path.dirname(__file__)
print '*** sys.path:'
pprint.pprint(sys.path)

before line 38 of genutils (the failing one) so we can read the full
sys.path.  That might give us a clue as to what's going on.

Here's the result:

> >>> import os,sys,pprint
> >>> print '*** Module path:',os.path.dirname(__file__)
> *** Module path:
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> NameError: name '__file__' is not defined

No, those prompts indicate that you are *typing* these things at a
command prompt, you didn't put them in the file where I told you.
The above error can simply *NOT* happen inside a file, since __file__
is always defined when a module is loaded.

Please follow *exactly* the instructions we ask you when trying to
debug something, otherwise it's impossible to help you.

> I am not getting any error, more than what I had attached earlier.

No, the error report you first sent, as I told you, was incomplete.
We need the *complete* exception traceback, with the (most important)
actual exception type and value.

I'm sorry, but it's impossible to provide meaningful help, and a waste
of everyone's time, with incomplete information such as this.

Also note that as of this weekend, I'll be mostly off-line at a
conference, hence unable to provide much assistance.  But others on
the list may be able to help: that's why these things are discussed on
a public list and not on private email, so that we can pool everyone's
time and resources to try and help (since individually, we're all
pretty swamped).

Cheers,

f

> Thank you again for your time and help.
>
> With Regards
> Rahul.
>
>
>
> Quoting Fernando Perez <fperez@colorado.edu>:
>
> > Please subscribe to the mailing list
> >
> > http://projects.scipy.org/mailman/listinfo/ipython-user
> >
> > to continue this discussion there, so that it gets archived for
> > everyone's benefit.  There's also a good chance another user may have
> > good insights on your problem.
> >
> > My reply is below, but you'll need to be subscribed for further posting.
> >
> > On 8/9/07, rbiswas@uwm.edu <rbiswas@uwm.edu> wrote:
> > > Sir,
> > > I am new to Python, and have just downloaded and installed Python-2.5.1
> > from
> > > www.python.org, and then installed ipython from tar file.
> > >
> > > -> ipython-0.8.1.tar.gz
> > >
> > > I followed the instructions and installed under, /opt/ipython, being a su.
> > >
> > > -> python setup.py install --prefix=/opt/ipython
> > >
> > > Then I sourced ipython in my  .bashrc profile
> > >
> > > -> export PYTHON=python
> > > -> export PYTHONPATH=$PYTHONPATH:/opt/lib/python2.5/site-packages/
> > > -> export IPYTHON=/opt/ipython
> > > -> export PATH=$PATH:$IPYTHON/bin
> > > -> export PYTHONPATH=$PYTHONPATH:$IPYTHON/lib/python2.5/site-packages/
> > >
> > >
> > > When I type ipython in the command line, it gives me the following error
> > > message, and I have no idea how to deal with it.
> > >
> > > Traceback (most recent call last):
> > >   File "/opt/ipython/bin/ipython", line 26, in <module>
> > >     import IPython
> > >   File "/opt/ipython/lib/python2.5/site-packages/IPython/__init__.py", line
> > 60,
> > > in <module>
> > >     __import__(name,glob,loc,[])
> > >   File "/opt/ipython/lib/python2.5/site-packages/IPython/genutils.py", line
> > 38,
> > > in <module>
> > >     from path import path
> > >
> > > I may be wrong, but wouldn't it be
> > >
> > > -> from os import path.
> > >
> > > In line 38,if that is not the case, then it will be great if you can help
> > me
> > > understand the problem. I thank you for your time and help.
> >
> > No, that line is correct: it imports the 'path' module, by Jason
> > Orendorff, which we ship internally inside IPython.Extensions.  That
> > directory should be added to the search path in IPython's __init__.
> >
> > I'm honestly puzzled by your error, I can't reproduce it here with
> > installing 0.8.1 to any location (even non-standard ones), and you
> > seem to have configured your PYTHONPATH correctly.
> >
> > A few things to try:
> >
> > - Make sure you give us the *full* traceback.  The one you have above
> > cut out the end, and the actual exception is missing.  We need to see
> > that.
> >
> > - Try putting
> > import os,sys,pprint;
> > print '*** Module path:',os.path.dirname(__file__)
> > print '*** sys.path:'
> > pprint.pprint(sys.path)
> >
> > before line 38 of genutils (the failing one) so we can read the full
> > sys.path.  That might give us a clue as to what's going on.
> >
> >
> > If anyone else has any idea, please speak up.  I may be missing
> > something obvious.
> >
> > cheers,
> >
> > f


More information about the IPython-user mailing list