How to install pymqi in window 64-bit?
Asked Answered
L

3

6

I am trying to install pymqi on windows 64-bit machine.

"pip install pymqi" gives an error

Collecting pymqi
  Using cached https://files.pythonhosted.org/packages/15/d9/b5babbd3f296b47a9d8bca417ca185ede9e8780ce4ca6b66bbf2dd1b7880/pymqi-1.9.2.tar.gz
Installing collected packages: pymqi
  Running setup.py install for pymqi ... error
    Complete output from command C:\Users\xxxxxxxxx\.virtualenvs\BBG_IBM_MQ_connection\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\xxxxxxxxx\\AppData\\Local\\
Temp\\pip-install-1qy7i0yt\\pymqi\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --recor
d C:\Users\xxxxxxxxx\AppData\Local\Temp\pip-record-hhuxyqkh\install-record.txt --single-version-externally-managed --compile --install-headers C:\Users\xxxxxxxxx\.virtualenvs\BBG_IBM_MQ_con
nection\include\site\python3.7\pymqi:
    Building PyMQI client 64bits
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.7
    creating build\lib.win-amd64-3.7\pymqi
    copying pymqi\__init__.py -> build\lib.win-amd64-3.7\pymqi
    copying pymqi\CMQC.py -> build\lib.win-amd64-3.7\pymqi
    copying pymqi\CMQCFC.py -> build\lib.win-amd64-3.7\pymqi
    copying pymqi\CMQXC.py -> build\lib.win-amd64-3.7\pymqi
    copying pymqi\CMQZC.py -> build\lib.win-amd64-3.7\pymqi
    running build_ext
    building 'pymqi.pymqe' extension
    creating build\temp.win-amd64-3.7
    creating build\temp.win-amd64-3.7\Release
    creating build\temp.win-amd64-3.7\Release\pymqi
    C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.21.27702\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DPYQMI_SERVERBUILD=0 "-Ic:\Program Fi
les (x86)\IBM\WebSphere MQ\tools\c\include" -IC:\Users\xxxxxxxxx\.virtualenvs\BBG_IBM_MQ_connection\include -IC:\Users\xxxxxxxxx\AppData\Local\Programs\Python\Python37\include -IC:\Users\
xxxxxxxxx\AppData\Local\Programs\Python\Python37\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.21.27702\include" /Tcpymqi/pymqe.c /Fobuild\temp.
win-amd64-3.7\Release\pymqi/pymqe.obj
    pymqe.c
    pymqi/pymqe.c(78): fatal error C1083: Cannot open include file: 'cmqc.h': No such file or directory
    error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.21.27702\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2

    ----------------------------------------
Command "C:\Users\xxxxxxxxx\.virtualenvs\BBG_IBM_MQ_connection\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\xxxxxxxxx\\AppData\\Local\\Temp\\pip-install-1qy7i0
yt\\pymqi\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\xxxxxxxxx\AppD
ata\Local\Temp\pip-record-hhuxyqkh\install-record.txt --single-version-externally-managed --compile --install-headers C:\Users\xxxxxxxxx\.virtualenvs\BBG_IBM_MQ_connection\include\site\pyt
hon3.7\pymqi" failed with error code 1 in C:\Users\xxxxxxxxx\AppData\Local\Temp\pip-install-1qy7i0yt\pymqi\

I tried to install "python-dev" as I read for pymqi installation, python-dev is necessary. But it is also giving an error and after searching for that error, got to know from this forum that "python-dev" doesn't exist for windows.

Can I get help on this?

Louvenialouver answered 23/5, 2019 at 19:37 Comment(2)
that doesn't solve my error, I have error: fatal error C1083: Cannot open include file: 'cmqc.h': No such file or directory error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.21.27702\bin\HostX86\x64\cl.exeLouvenialouver
developer.ibm.com/articles/mq-downloads/#pythonDemogorgon
H
3

Download MQ client libraries from this link: https://ibm.biz/IBM-MQC-Redist-Win64zip

Once downloaded and extracted, you will find the cmqc.h file in this location:

9.3.0.0-IBM-MQC-Redist-Win64\tools\c\include

Create a new folder on your C: drive:

C:\Program Files (x86)\IBM\WebSphere MQ

Copy the tools subfolder

9.3.0.0-IBM-MQC-Redist-Win64\tools\c\include

to

C:\Program Files (x86)\IBM\WebSphere MQ

Now run:

pip install pymqi

The output should be similar to this:

C:\Windows\system32>pip install pymqi
Collecting pymqi
  Using cached pymqi-1.12.8.tar.gz (88 kB)
  Preparing metadata (setup.py) ... done
Using legacy 'setup.py install' for pymqi, since package 'wheel' is not installed.
Installing collected packages: pymqi
  Running setup.py install for pymqi ... done
Successfully installed pymqi-1.12.8

For me it worked. Please give it a try and let me know if it worked for you.

Hemihydrate answered 24/8, 2022 at 18:14 Comment(1)
In my case, I had to extract all the contents of ibm.biz/IBM-MQC-Redist-Win64zip into c:\Program Files (x86)\IBM\WebSphere MQ or C:\IBM\MQRebel
A
2

pymqi is a Python wrapper for IBM MQ SDK. You need to install the SDK to compile pymqi from sources.

See https://github.com/dsuch/pymqi/issues/15#issuecomment-124772995.

https://www.ibm.com/support/knowledgecenter/SSFKSJ/com.ibm.mq.helphome.doc/product_welcome_wmq.htm

Allina answered 23/5, 2019 at 23:51 Comment(0)
N
1

You would need 2 things - IBM MQ Client and and Visual C++ from Microsoft

https://www.microsoft.com/en-au/download/details.aspx?id=44266 C++ build is available here and

IBM MQ client is available on the IBM site. Setting up MQ service/manager would be overkill. just the client is sufficient enough.

Nasa answered 27/2, 2020 at 21:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.