Way back when I installed SQLalchemy 0.3.3 in such a way that it wound up in .../site-packages/easy-install.pth: ... ./SQLAlchemy-0.3.3-py2.4.egg ... A colleague installed a later version in a different directory, referenced that in PYTHONPATH but still got the old version: udesktop116% PYTHONPATH=/opt/tradelink/research/site-packages.beta python -c 'import sqlalchemy ; print sqlalchemy.__file__' /opt/app/g++lib6/python-2.4/lib/python2.4/site-packages/SQLAlchemy-0.3.3-py2.4.egg/sqlalchemy/__init__.pyc udesktop116% ls /opt/tradelink/research/site-packages.beta BeautifulSoup.py _mssql.so pylab.py Cython configobj.py pylab.pyc IPython dateutil pymssql.py Jinja-1.2-py2.4-solaris-2.10-i86pc.egg docutils-0.4-py2.4.egg pymssql.pyc PIL easy-install.pth pyparsing.py PIL.pth enthought pytz Pygments-0.10-py2.4.egg fpconst.py pyximport Pyrex fpconst.pyc research SOAPpy lib scipy SQLAlchemy-0.5.0rc3dev_r5205-py2.4.egg matplotlib timeseries Sphinx-0.3-py2.4.egg mpl_toolkits tlsec Symbide-0.3.1-py2.4.egg numpy __init__.py pyExcelerator Looking at sys.path shows why: PYTHONPATH=/opt/tradelink/research/site-packages.beta python -c 'import sys ; print sys.path' ['', '/opt/app/g++lib6/python-2.4/lib/python2.4/site-packages/zope.interface-3.3.0-py2.4-solaris-2.10-i86pc.egg', '/opt/app/g++lib6/python-2.4/lib/python2.4/site-packages/pycrypto-2.0.1-py2.4-solaris-2.10-i86pc.egg', '/opt/app/g++lib6/python-2.4/lib/python2.4/site-packages/magnitude-0.9.3-py2.4.egg', '/opt/app/g++lib6/python-2.4/lib/python2.4/site-packages/setuptools-0.6c7-py2.4.egg', '/opt/app/g++lib6/python-2.4/lib/python2.4/site-packages/paramiko-1.7.2-py2.4.egg', '/opt/app/g++lib6/python-2.4/lib/python2.4/site-packages/processing-0.52-py2.4-solaris-2.10-i86pc.egg', '/opt/app/g++lib6/python-2.4/lib/python2.4/site-packages/pp-1.5.4-py2.4.egg', '/opt/app/g++lib6/python-2.4/lib/python2.4/site-packages/greenlet-0.1-py2.4-solaris-2.10-i86pc.egg', '/opt/app/g++lib6/python-2.4/lib/python2.4/site-packages/MDP-2.3-py2.4.egg', '/opt/app/g++lib6/python-2.4/lib/python2.4/site-packages/hashlib-20060408a-py2.4-solaris-2.10-i86pc.egg', '/opt/app/g++lib6/python-2.4/lib/python2.4/site-packages/nose-0.10.3-py2.4.egg', '/opt/app/g++lib6/python-2.4/lib/python2.4/site-packages/coverage-2.85-py2.4.egg', '/opt/app/g++lib6/python-2.4/lib/python2.4/site-packages/daemon-1.0.1-py2.4.egg', '/opt/app/g++lib6/python-2.4/lib/python2.4/site-packages/SQLAlchemy-0.3.3-py2.4.egg', '/opt/tradelink/research/site-packages.beta', '/opt/app/g++lib6/python-2.4/lib/python24.zip', '/opt/app/g++lib6/python-2.4/lib/python2.4', '/opt/app/g++lib6/python-2.4/lib/python2.4/plat-sunos5', '/opt/app/g++lib6/python-2.4/lib/python2.4/lib-tk', '/opt/app/g++lib6/python-2.4/lib/python2.4/lib-dynload', '/opt/app/g++lib6/python-2.4/lib/python2.4/site-packages', '/opt/app/g++lib6/python-2.4/lib/python2.4/site-packages/3rdParty', '/opt/app/g++lib6/python-2.4/lib/python2.4/site-packages/3rdParty/Numeric'] The beta site-packages directory does indeed appear ahead of the normal site-packages, but the contents of easy-install.pth are all ahead of that. In my opinion they should be inserted right before the directory in which their .pth file was found. Why is this not the case? In case it's a setuptools/easy_install thing, I'm using setuptools 0.6c7 with Python 2.4.5. Thanks, Skip
At 11:40 AM 10/29/2008 -0500, skip@pobox.com wrote:
Way back when I installed SQLalchemy 0.3.3 in such a way that it wound up in .../site-packages/easy-install.pth:
... ./SQLAlchemy-0.3.3-py2.4.egg ...
A colleague installed a later version in a different directory, referenced that in PYTHONPATH but still got the old version:
udesktop116% PYTHONPATH=/opt/tradelink/research/site-packages.beta python -c 'import sqlalchemy ; print sqlalchemy.__file__'
/opt/app/g++lib6/python-2.4/lib/python2.4/site-packages/SQLAlchemy-0.3.3-py2.4.egg/sqlalchemy/__init__.pyc udesktop116% ls /opt/tradelink/research/site-packages.beta BeautifulSoup.py _mssql.so pylab.py Cython configobj.py pylab.pyc IPython dateutil pymssql.py Jinja-1.2-py2.4-solaris-2.10-i86pc.egg docutils-0.4-py2.4.egg pymssql.pyc PIL easy-install.pth pyparsing.py PIL.pth enthought pytz Pygments-0.10-py2.4.egg fpconst.py pyximport Pyrex fpconst.pyc research SOAPpy lib scipy SQLAlchemy-0.5.0rc3dev_r5205-py2.4.egg matplotlib timeseries Sphinx-0.3-py2.4.egg mpl_toolkits tlsec Symbide-0.3.1-py2.4.egg numpy __init__.py pyExcelerator
There's a special 'site.py' missing from this directory. You can fix that by doing this: cd /opt/tradelink/research/site-packages.beta PYTHONPATH=. easy_install -d . SQLAlchemy-0.5.0rc3dev_r5205-py2.4.egg My guess is that this directory was created by copying a site-packages directory from somewhere, or by easy_installing to it with the --site-dirs option. Either would have prevented easy_install from creating the site.py that's necessary to make this work. Without the special site.py, Python doesn't pick this directory up as a "site" directory, and doesn't process PYTHONPATH eggs properly. Note that you must use easy_install as described above to do this; you can't just copy Python's site.py, as it's not the same file. The one easy_install puts there forces .pth processing to occur on PYTHONPATH, and then invokes the original Python site.py.
Phillip> There's a special 'site.py' missing from this directory. You Phillip> can fix that by doing this: ... Thanks for the quick response. We'll look into it. Skip
participants (2)
-
Phillip J. Eby -
skip@pobox.com