1

I'm getting strange ImportError exception while importing to my script pymqi.

  1. I installed WebSphere MQ for windows 7.5, both user and client versions.
  2. I tried to run pip install pymqi, but there was problems at C++ compiling.
  3. I moved headers from C:\Program Files (x86)\IBM\WebSphere MQ\tools\c\include to C:\Python27\include and tried to run, there were linking problem.
  4. I moved some .lib files from C:\Program Files (x86)\IBM\WebSphere MQ\tools\Lib to C:\Python27\libs and it compiled well.

Then I tried this code:

import pymqi
queue_manager = "QM"
channel = "SVRCONN"
host = "192.168.1.252"
port = "1434"
conn_info = "%s(%s)" % (host, port)
qmgr = pymqi.connect(queue_manager, channel, conn_info)
qmgr.disconnect()

And at import library I got:

  File "build\bdist.win32\egg\pymqe.py", line 7, in <module>
  File "build\bdist.win32\egg\pymqe.py", line 6, in __bootstrap__
ImportError: DLL load failed: �� ������ ��������� ������.

Where after some manipulations I got that ...��... means: it can't find module.

  1. I decide that done something wrong. Downloaded pymqi-1.3 and done setup.py build + setup.py install, that finished successfully. But problem still was there.
  2. I moved all DLL files from C:\Program Files (x86)\IBM\WebSphere MQ\bin to C:\Python27

And got another ImportError exception with text, that may be translated as "Bad try to access to memory address".

  1. I tried springpython library, but it uses pymqi inside, so falls with same exceptions.

How can I finally solve this problem? I guess there may be problem at WebSphere side, but how to check it? "WS Explorer" runs well.

JoshMc
  • 10,239
  • 2
  • 19
  • 38
Arkady
  • 2,084
  • 3
  • 27
  • 48

1 Answers1

1

I had the same problem. Re-installing the client seemed to fix it. Ensure that you have the following items in your PATH variable:

C:\Program Files (x86)\IBM\WebSphere MQ\bin64; C:\Program Files (x86)\IBM\WebSphere MQ\bin; C:\Program Files (x86)\IBM\WebSphere MQ\tools\c\samples\bin

Ewanw
  • 728
  • 11
  • 30