[rabbitmq-discuss] First Python sample (send.py) gives error: AttributeError: 'ProtocolHeader' object has no attribute 'channel_number'

Marek Majkowski majek04 at gmail.com
Fri Jul 1 18:48:40 BST 2011


Right,

Google says it may be due to an outdated version of RabbitMQ.

Can you make sure you're using RabbitMQ > 2.0 ?

Explanation: rabbitmq < 2.0 spoke AMQP 0-8,
recent pika and recent RabbitMQ speak AMQP 0-9-1.

Cheers,
  Marek

On Fri, Jul 1, 2011 at 18:14, Matt Pietrek <mpietrek at skytap.com> wrote:
> Mark,
>
> Thanks for getting back to me.
>
> Yes, I installed it exactly as specified on the tutorial page. I
> copied/pasted the command line.
>
> Just to be sure, I ran it again and got this output:
>
> foo at foo:~$ sudo pip install -e
> git+http://github.com/pika/pika.git@v0.9.5#egg=pika-v0.9.5
> Checking out pika-v0.9.5 from
> git+http://github.com/pika/pika.git@v0.9.5#egg=pika-v0.9.5 checkout from
> git+http://github.com/pika/pika.git@v0.9.5#egg=pika-v0.9.5
>  Cloning http://github.com/pika/pika.git (to revision v0.9.5) to
> ./src/pika-v0.9.5
>  Running setup.py egg_info for package pika-v0.9.5
> Installing collected packages: pika-v0.9.5
>  Running setup.py develop for pika-v0.9.5
>    Creating /usr/local/lib/python2.6/dist-packages/pika.egg-link (link to
> .)
>    Adding pika 0.9.5 to easy-install.pth file
>
>    Installed /home/highland/src/pika-v0.9.5
> Successfully installed pika-v0.9.5
>
>
> On 7/1/11 3:22 AM, "Marek Majkowski" <majek04 at gmail.com> wrote:
>
>>Matt,
>>
>>Looks like you have a wrong version of pika.
>>
>>Are you sure you have pika 0.9.5 exactly?
>>
>>Have you installed it as suggested on the tutorial page, using pip:
>>   pip install -e
>>git+http://github.com/pika/pika.git@v0.9.5#egg=pika-v0.9.5
>>
>>Cheers!
>>  Marek
>>
>>On Thu, Jun 30, 2011 at 23:13, Matt Pietrek <mpietrek at skytap.com> wrote:
>>> I've just now followed the directions verbatim from
>>> here: http://www.rabbitmq.com/tutorials/tutorial-one-python.html
>>> I've copied/pasted the sample code for send.py and receive.py directly
>>>from
>>> the web page so as to eliminate errors. Unfortunately, I'm getting the
>>> following error:
>>>
>>> foo at foo-desktop:~/rabbitmq-test$ python send.py
>>>
>>> Traceback (most recent call last):
>>>
>>>   File "send.py", line 4, in <module>
>>>
>>>     connection =
>>> pika.BlockingConnection(pika.ConnectionParameters(host='localhost'))
>>>
>>>   File "/home/foo/src/pika-v0.9.5/pika/adapters/blocking_connection.py",
>>> line 32, in __init__
>>>
>>>     BaseConnection.__init__(self, parameters, None,
>>>reconnection_strategy)
>>>
>>>   File "/home/foo/src/pika-v0.9.5/pika/adapters/base_connection.py",
>>>line
>>> 50, in __init__
>>>
>>>     reconnection_strategy)
>>>
>>>   File "/home/foo/src/pika-v0.9.5/pika/connection.py", line 170, in
>>>__init__
>>>
>>>     self._connect()
>>>
>>>   File "/home/foo/src/pika-v0.9.5/pika/connection.py", line 228, in
>>>_connect
>>>
>>>     self.parameters.port or  spec.PORT)
>>>
>>>   File "/home/foo/src/pika-v0.9.5/pika/adapters/blocking_connection.py",
>>> line 44, in _adapter_connect
>>>
>>>     self._handle_read()
>>>
>>>   File "/home/foo/src/pika-v0.9.5/pika/adapters/base_connection.py",
>>>line
>>> 162, in _handle_read
>>>
>>>     self._on_data_available(data)
>>>
>>>   File "/home/foo/src/pika-v0.9.5/pika/connection.py", line 597, in
>>> _on_data_available
>>>
>>>     elif frame.channel_number > 0:
>>>
>>> AttributeError: 'ProtocolHeader' object has no attribute
>>>'channel_number'
>>>
>>> Python version is 2.6.5. I'm running this on an ubuntu 10.4 system. Pip
>>>and
>>> Pika were downloaded today per the web site instructions.
>>>
>>> I've searched everywhere and can't see the error referenced.
>>>
>>> Many thanks to anybody that can help me.
>>>
>>> Matt Pietrek.
>>>
>>>
>>> _______________________________________________
>>> rabbitmq-discuss mailing list
>>> rabbitmq-discuss at lists.rabbitmq.com
>>> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>>>
>>>
>
>
>


More information about the rabbitmq-discuss mailing list