You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pylucene-dev@lucene.apache.org by Bill Janssen <ja...@parc.com> on 2010/03/03 06:33:03 UTC

Re: Arghh! Makefile mysteries...

Andi Vajda <va...@apache.org> wrote:

> Maybe it is because Python picks stuff from site-packages first ? (not sure)

Maybe so.  Anytime setuptools is involved, I suspect just that.  That
bug is still in the setuptools tracker.

But I created a Makefile with just this in it:

all:
        python -c "import os; print os.environ.get('PYTHONPATH')"
        python -c "import sys; print sys.path"
        python -m jcc --version

And then I do a "make all" on it.  The last line errs out, but does so
with the right stack trace, if PYTHONPATH is set.  What I don't understand
is what the difference is between this and the PyLucene Makefile.

Bill

/tmp/x 91 % make all
python -c "import os; print os.environ.get('PYTHONPATH')"
None
python -c "import sys; print sys.path"
['', '/usr/lib/python2.5/site-packages/JCC-1.9-py2.5-linux-i686.egg', '/usr/lib/python2.5/site-packages/lucene-2.4.0_649619-py2.5-linux-i686.egg', '/usr/lib/python2.5/site-packages/setuptools-0.6c9-py2.5.egg', '/usr/lib/python2.5/site-packages/vobject-0.8.1c-py2.5.egg', '/usr/lib/python2.5/site-packages/python_dateutil-1.4.1-py2.5.egg', '/usr/lib/python25.zip', '/usr/lib/python2.5', '/usr/lib/python2.5/plat-linux2', '/usr/lib/python2.5/lib-tk', '/usr/lib/python2.5/lib-dynload', '/usr/lib/python2.5/site-packages', '/usr/lib/python2.5/site-packages/Numeric', '/usr/lib/python2.5/site-packages/PIL', '/usr/lib/python2.5/site-packages/gst-0.10', '/usr/lib/python2.5/site-packages/gtk-2.0', '/opt/uplib-1.7.5/lib/python2.5/site-packages', '/opt/uplib-1.7.5/lib/python2.5/site-packages/PIL', '/opt/uplib-1.7.9/lib/python2.5/site-packages', '/opt/uplib-1.7.9/lib/python2.5/site-packages/PIL']
python -m jcc --version
Traceback (most recent call last):
  File "/usr/lib/python2.5/runpy.py", line 95, in run_module
    filename, loader, alter_sys)
  File "/usr/lib/python2.5/runpy.py", line 52, in _run_module_code
    mod_name, mod_fname, mod_loader)
  File "/usr/lib/python2.5/runpy.py", line 32, in _run_code
    exec code in run_globals
  File "/usr/lib/python2.5/site-packages/JCC-1.9-py2.5-linux-i686.egg/jcc/__init__.py", line 28, in <module>
    cpp.jcc(sys.argv)
  File "/usr/lib/python2.5/site-packages/JCC-1.9-py2.5-linux-i686.egg/jcc/cpp.py", line 308, in jcc
    version = args[i]
IndexError: list index out of range
make: *** [all] Error 255
greta : /tmp/x 89 % setenv PYTHONPATH /opt/uplib-1.7.9/lib/python2.5/site-packages
greta : /tmp/x 90 % make all
python -c "import os; print os.environ.get('PYTHONPATH')"
/opt/uplib-1.7.9/lib/python2.5/site-packages
python -c "import sys; print sys.path"
['', '/opt/uplib-1.7.9/lib/python2.5/site-packages/setuptools-0.6c9-py2.5.egg', '/opt/uplib-1.7.9/lib/python2.5/site-packages/vobject-0.8.1c-py2.5.egg', '/opt/uplib-1.7.9/lib/python2.5/site-packages/JCC-2.4.1-py2.5-linux-i686.egg', '/opt/uplib-1.7.9/lib/python2.5/site-packages/lucene-2.9.1-py2.5-linux-i686.egg', '/usr/lib/python2.5/site-packages/JCC-1.9-py2.5-linux-i686.egg', '/usr/lib/python2.5/site-packages/lucene-2.4.0_649619-py2.5-linux-i686.egg', '/usr/lib/python2.5/site-packages/setuptools-0.6c9-py2.5.egg', '/usr/lib/python2.5/site-packages/vobject-0.8.1c-py2.5.egg', '/usr/lib/python2.5/site-packages/python_dateutil-1.4.1-py2.5.egg', '/opt/uplib-1.7.9/lib/python2.5/site-packages', '/usr/lib/python25.zip', '/usr/lib/python2.5', '/usr/lib/python2.5/plat-linux2', '/usr/lib/python2.5/lib-tk', '/usr/lib/python2.5/lib-dynload', '/usr/lib/python2.5/site-packages', '/usr/lib/python2.5/site-packages/Numeric', '/usr/lib/python2.5/site-packages/PIL', '/usr/lib/python2.5/site-packa
 ges/gst-0.10', '/usr/lib/python2.5/site-packages/gtk-2.0', '/opt/uplib-1.7.5/lib/python2.5/site-packages', '/opt/uplib-1.7.5/lib/python2.5/site-packages/PIL', '/opt/uplib-1.7.9/lib/python2.5/site-packages/PIL']
python -m jcc --version
Traceback (most recent call last):
  File "/usr/lib/python2.5/runpy.py", line 95, in run_module
    filename, loader, alter_sys)
  File "/usr/lib/python2.5/runpy.py", line 52, in _run_module_code
    mod_name, mod_fname, mod_loader)
  File "/usr/lib/python2.5/runpy.py", line 32, in _run_code
    exec code in run_globals
  File "/opt/uplib-1.7.9/lib/python2.5/site-packages/JCC-2.4.1-py2.5-linux-i686.egg/jcc/__init__.py", line 27, in <module>
    import jcc.__main__
  File "/opt/uplib-1.7.9/lib/python2.5/site-packages/JCC-2.4.1-py2.5-linux-i686.egg/jcc/__main__.py", line 88, in <module>
    cpp.jcc(sys.argv)
  File "/opt/uplib-1.7.9/lib/python2.5/site-packages/JCC-2.4.1-py2.5-linux-i686.egg/jcc/cpp.py", line 337, in jcc
    version = args[i]
IndexError: list index out of range
make: *** [all] Error 255
/tmp/x 91 % 

> I think this whole mess would be a lot simpler if you used virtualenv.py.
> 
>   http://pypi.python.org/pypi/virtualenv
> 
> It lets you do what you're trying to do - install stuff without
> affecting a user's install, yet override some of their libs in a
> special place inheriting from their setup otherwise if you so choose.

No thanks.  Just more complexity to manage.  I'd like to get setuptools
out of the mix.  It's easy_install.pth that's screwing up the sys.path
order.

Bill