-1

I have a script in python which is used to connect to RabbitMQ server and consumes messages. When i tried to run the script from command prompt as "./pikascript.py" i am getting the proper output but the same script when i try to execute as "python pikascript.py" i get the following error:

WARNING:pika.adapters.base_connection:Connection to 16.125.72.210:5671 failed: [Errno 1] _ssl.c:503: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version
Traceback (most recent call last):
  File "pikascript.py", line 39, in <module>
    ssl=True, ssl_options=ssl_options))
  File "build\bdist.win-amd64\egg\pika\adapters\blocking_connection.py", line 130, in __init__
  File "build\bdist.win-amd64\egg\pika\adapters\base_connection.py", line 72, in __init__
  File "build\bdist.win-amd64\egg\pika\connection.py", line 600, in __init__
  File "build\bdist.win-amd64\egg\pika\adapters\blocking_connection.py", line 230, in connect
  File "build\bdist.win-amd64\egg\pika\adapters\blocking_connection.py", line 301, in _adapter_connect
pika.exceptions.AMQPConnectionError: Connection to 16.125.72.210:5671 failed: [Errno 1] _ssl.c:503: error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version

I gave the proper path in the environmenal variables. Are there any dependencies to run the pika libraries.. Could someone please help me out.

Lorenzo Belli
  • 1,767
  • 4
  • 25
  • 46
Madhuri
  • 101
  • 1
  • 5
  • 11

1 Answers1

0

When I tried to run the script from command line as "./pikascript.py" it is referring to the python path in "C:\Python\python.exe", but when I run the same script as "python pikascript.py" it refers to another python path in the same machine, where setup tools and pika library are not installed properly.
So I started executing the script as "C:\Python\python.exe pikascript.py" and script gets executed without any error.

Mouse on the Keys
  • 322
  • 1
  • 5
  • 13
Madhuri
  • 101
  • 1
  • 5
  • 11