[Edu-sig] Fw: pyGeo problems: linux progress : an oddity

Gary Pajer pajer@iname.com
Sun, 12 Jan 2003 12:09:30 -0500


Thanks Guido and Art.

PyGeo is working now, BUT:

I have some odd behavior for you.  The *.pth mechanism won't work as
expected in this case.

The punch line is in 7.) below.
Recall that I've got Linux Mandrake 9.0, and the version of python that
comes with it (2.2.1)
I don't know if it's worth any effort to track this down, since things are
working for me.  But I'll let you decide.


1.)  Setting PYTHONPATH works fine, once I did it correctly.

2.)  I have Numeric in .../site-packages and a file Numeric.pth that points
to it.  The directory .../site-packages/Numeric appears in sys.path.

3.)   I have PyGeo in .../site-packages and a file PyGeo.pth that points to
it.  The directory .../site-packages/PyGeo *does not* appears in sys.path.

4.)  I have an empty directory 'test' in .../site-packages and a file
test.pth that points to it.  The directory .../site-packages/test *does*
appears in sys.path.

5.) I have renamed .../site-packages/PyGeo, PyGeo.pth, and it's content
pointer all to lower case 'pygeo'.  The directory *does not* appear in
sys.path.

6.) I have recopied, rewrote, reinstalled all of the PyGeo files several
times, makeing sure that spellings were correct, that PyGeo.pth (or
pygeo.pth)  had no extra spaces.  (In all cases, including the cases for
Numeric and test, the .pth file contains one word, the directory name,
followed by a newline.)  In no case did the PyGeo directory appear in
sys.path

7.)  I copied PyGeo into a new directory called xxx, and create xxx.pth
pointing to the directory, and .../site-packages/xxx **does** appear in
sys.path.   !!!   And PyGeo runs flawlessly.

8.) Under Win98, PyGeo and PyGeo.pth both live in c:/python22.
c:/python22/PyGeo *does* appear in sys.path.

I suppose that despite all my care, it's still possible that I misspelled
something.  But I really tried hard.
And if I simply unzip the PyGeo dist. into site-packages it does not work.
If I simply unzip the PyGeo dist under Win98, it *does* work.

Regards,
Gary

(P.S. to Art:  obviously, none of this bears on our original PyGeo problem
under Win98.  That problem is still there.)




> > I would very much appreciate it if someone could help me respond to
Gary.
> >
> > Thanks,
> >
> > Art
>
> There are several solutions:
>
> - You can set the environment variable PYTHONPATH to point to
>   /usr/lib/python2.2/PyGeo: assuming a bash shell:
>
>   $ PYTHONPATH=/usr/lib/python2.2/PyGeo
>   $ export PYTHONPATH
>   $ python yourscript.py
>
> - You can copy the *contents* of PyGeo into
>   /usr/lib/python2.2/site-packages (a directory that *is* on the
>   path by default).
>
> - You can create a file "/usr/lib/python2.2/site-packages/PyGeo.pth"
>   whose contents is one line containing the single string
>
>     /usr/lib/python2.2/PyGeo
>
>   (left-aligned, no spaces before or after on the same line).
>
> --Guido van Rossum (home page: http://www.python.org/~guido/)
>
> > ----- Original Message -----
> > From: "Gary Pajer" <pajer@iname.com>
> > To: "Arthur" <ajs@ix.netcom.com>
> > Sent: Saturday, January 11, 2003 12:41 PM
> > Subject: Re: pyGeo problems: linux progress
> >
> >
> > > Art,
> > >
> > > PyGeo seems to run well under linux (Mandrake 9.0) if you can get it
> > going.
> > >
> > > I'm now facing a python issue that's always confused me.  Maybe you
can
> > > help.  If not, I'll post to the python newsgroup.
> > >
> > > The problem on my system seems to be that /usr/lib/python2.2/PyGeo
> > doesn't
> > > appear in sys.path.  It does on my Win98 installation, but not on my
> > linux.
> > > How is sys.path initialized?  How did those entries get there?  How is
it
> > > that Win98 knows about it but linux doesn't?  I installed both the
same
> > way:
> > > from the zip.
> > >
> > > If I modify your demo scripts to add the directory by hand, everything
> > works
> > > splendidly:
> > >
> > > import sys
> > > sys.path.append('/usr/lib/python2.2/PyGeo')
> > >
> > > and away we go.
> > >
> > > I think everything will be fine if I can figure out how to get that
> > > directory on sys.path by default.  Do you know how to do that?
> > >
> > > -Gary
> > >
> >
> >
> > _______________________________________________
> > Edu-sig mailing list
> > Edu-sig@python.org
> > http://mail.python.org/mailman/listinfo/edu-sig
>