Writing tests to communicate with IBM MQ

I am using the PyMQI library within the Robot Framework to exchange messages with IBM MQ queues. This is done by writing simple Python scripts and invoking them from robot test cases.
I would like to use the PyMQI library and its Keywords directly from within RIDE.
However when I try to import and use the PyMQI library within RIDE the following errors are thrown when I try to run a test.

[ ERROR ] Error in library ‘pymqi’: Adding keyword ‘Common Q Args’ failed: Keyword with same name defined multiple times.
[ ERROR ] Error in library ‘pymqi’: Adding keyword ‘Make Q Desc’ failed: Keyword with same name defined multiple times.

Any help would be appreciated.

I am not familiar with that library. Please attach a small example. It would be nice if we can execute it with some public MQ server, or faking on our machines.

I also need to know if you can run without problems on command line, and the problem is only when using RIDE.

I’d make a separate wrapper library that imports pymqi, import the methods needed and wrap them into keywords … Using python library that is not intended as robot framework keyword library may work in some cases but will lead to results – like you are seeing now.

Thanks for your responses guys. Finally I did not try to integrate this library in RIDE but simply refer to a python script from within RIDE and pass MQ related values via parameters. This python script handles the MQ connections

Hey Kevin, How did you do that?
I was trying the similar way (using PyMQI Library) but getting the same error as you were getting earlier.
What was the script that you used to pass the MQ parameters? Can you post here?

Sorry for the slow response just saw the mail now.
I created a python script
putmq.py (takes 8 parameters) to insert messages into an MQ Queue - see below

This putmq.py script is executed within a robot test as follows
${result}= Run Process python3 ${robot_python_scripts_dir}/putmq.py ${queuemanager} ${channel} ${host} ${port} ${${queue_put}} ${user} ${password} ${filename}

putmq.py

import pymqi
import sys

queue_manager=sys.argv[1]
channel = sys.argv[2]
host = sys.argv[3]
port = sys.argv[4]
queue_name = sys.argv[5]
conn_info = ‘%s(%s)’ % (host, port)

user = sys.argv[6]
password = sys.argv[7]
filename = sys.argv[8]
qmgr = pymqi.connect(queue_manager, channel, conn_info)
with open(filename,‘r’) as file:
message = file.read()
queue = pymqi.Queue(qmgr, queue_name)
queue.put(message)
queue.close()
qmgr.disconnect()