首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >用于windows构建和安装的PyMQI

用于windows构建和安装的PyMQI
EN

Stack Overflow用户
提问于 2015-11-06 23:05:25
回答 1查看 2.8K关注 0票数 3

我需要在Windows86x上安装PyMQI。我尝试使用msvc作为编译器来构建setup.py,但是当我尝试这样做时,我得到了以下错误:

代码语言:javascript
复制
C:\Python27\Lib\pymqi-1.5.4>python setup.py build client
Building PyMQI client 32bits
running build
running build_py
running build_ext
building 'pymqi.pymqe' extension
C:\Users\Admin\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD
 /W3 /GS- /DNDEBUG -DPYQMI_SERVERBUILD=0 "-Ic:\Program Files\IBM\WebSphere MQ\tools\c\include" -IC:\Python27\include -IC
:\Python27\PC /Tcpymqi/pymqe.c /Fobuild\temp.win32-2.7\Release\pymqi/pymqe.obj
pymqe.c
pymqi/pymqe.c(240) : error C2275: 'MQCSP' : illegal use of this type as an expression
        c:\Program Files\IBM\WebSphere MQ\tools\c\include\cmqc.h(4001) : see declaration of 'MQCSP'
pymqi/pymqe.c(240) : error C2146: syntax error : missing ';' before identifier 'csp'
pymqi/pymqe.c(240) : error C2065: 'csp' : undeclared identifier
pymqi/pymqe.c(240) : error C2059: syntax error : '{'
pymqi/pymqe.c(247) : error C2065: 'csp' : undeclared identifier
pymqi/pymqe.c(247) : error C2224: left of '.AuthenticationType' must have struct/union type
pymqi/pymqe.c(248) : error C2065: 'csp' : undeclared identifier
pymqi/pymqe.c(248) : error C2224: left of '.CSPUserIdPtr' must have struct/union type
pymqi/pymqe.c(249) : error C2065: 'csp' : undeclared identifier
pymqi/pymqe.c(249) : error C2224: left of '.CSPUserIdLength' must have struct/union type
pymqi/pymqe.c(250) : error C2065: 'csp' : undeclared identifier
pymqi/pymqe.c(250) : error C2224: left of '.CSPPasswordPtr' must have struct/union type
pymqi/pymqe.c(251) : error C2065: 'csp' : undeclared identifier
pymqi/pymqe.c(251) : error C2224: left of '.CSPPasswordLength' must have struct/union type
pymqi/pymqe.c(256) : error C2065: 'csp' : undeclared identifier
pymqi/pymqe.c(256) : warning C4133: '=' : incompatible types - from 'int *' to 'PMQCSP'
error: command 'C:\\Users\\Admin\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bi
n\\cl.exe' failed with exit status 2
EN

回答 1

Stack Overflow用户

发布于 2017-08-24 14:36:36

在这个页面上有一个解决方案:https://github.com/dsuch/pymqi/issues/35

pymqi/pymqe.c文件中的第一行声明行

代码语言:javascript
复制
MQCSP csp = {MQCSP_DEFAULT};

应该移到方法pymqe_MQCONNX的开头,紧跟在后面:

代码语言:javascript
复制
PyObject* user_password = NULL;

完成此操作后,构建和安装成功,但import pymqi给出错误:

代码语言:javascript
复制
ImportError: No module named pymqe

可以通过将pymqe.pyd从路径\pymqi-1.5.4\build\lib.win32-2.7\pymqi复制到pymqi-1.5.4\pymqi来修复此问题

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/33569714

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档