I have a python file that will not correctly perform an import.
If I go to the python prompt I can manually import the module without error.
Python 2.4.3 (#1, Feb 22 2012, 16:06:13)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from amqplib import client_0_8 as amqp
When I step through the program with pdb, the result of executing the import:
-> from amqplib import client_0_8 as amqp
(Pdb) s
--Call--
> /home/ralphie/Desktop/Projects/catamaran/build/bdist.linux-i686/egg/amqplib/__init__.py(0)?()
When I check sys.path:
Python 2.4.3 (#1, Feb 22 2012, 16:06:13)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-52)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from amqplib import client_0_8 as amqp
>>> import sys
>>> print sys.path
['', '/usr/lib/python2.4/site-packages/setuptools-0.6c11-py2.4.egg',
'/usr/lib /python2.4/site-packages/mechanize-0.2.5-py2.4.egg',
'/usr/lib/python2.4/site-packages/ClientForm-0.2.10-py2.4.egg',
'/usr/lib/python2.4/site-packages/simplejson-2.3.2-py2.4-linux-i686.egg',
'/usr/lib/python2.4/site-packages/amqplib-1.0.0-py2.4.egg',
'/usr/lib/python24.zip',
'/usr/lib/python2.4',
'/usr/lib/python2.4/plat-linux2',
'/usr/lib/python2.4/lib-tk',
'/usr/lib/python2.4/lib-dynload',
'/usr/lib/python2.4/site-packages',
'/usr/lib/python2.4/site-packages/Numeric',
'/usr/lib/python2.4/site-packages/PIL',
'/usr/lib/python2.4/site-packages/gtk-2.0']
It is not coming from environment variables, I’ve deleted all .pyo & .pyc files.
I just have no idea where that crazy egg reference is coming from.
Any clues sincerely appreciated.
Try upgrading python to a more recent version, I had a lot of issues with python2.4 and amqp.
Even though the import statement succeeded the functional logic is not tested or executed until called.