我正在Win7上安装pymqi软件包
pip install pymqi-1.7.2.tar.gz
但我得到的只是一个错误
LINK : error LNK2001: unresolved external symbol PyInit_pymqe
以下是cmd的完整列表:
pip install pymqi-1.7.2.tar.gz
Processing c:\pymqi-1.7.2.tar.gz
Building wheels for collected packages: pymqi
Running setup.py bdist_wheel for pymqi ... error
Complete output from command C:\ProgramData\Anaconda3\python.exe -u -c "import setuptools, toke
nize;__file__='C:\\Users\\ELYASH~1\\AppData\\Local\\Temp\\pip-dktwad4n-build\\setup.py';f=getattr
(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(cod
e, __file__, 'exec'))" bdist_wheel -d C:\Users\ELYASH~1\AppData\Local\Temp\tmp4f_xo1yupip-wheel-
--python-tag cp36:
Building PyMQI client 64bits
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.6
creating build\lib.win-amd64-3.6\pymqi
copying pymqi\__init__.py -> build\lib.win-amd64-3.6\pymqi
copying pymqi\CMQC.py -> build\lib.win-amd64-3.6\pymqi
copying pymqi\CMQCFC.py -> build\lib.win-amd64-3.6\pymqi
copying pymqi\CMQXC.py -> build\lib.win-amd64-3.6\pymqi
copying pymqi\CMQZC.py -> build\lib.win-amd64-3.6\pymqi
running build_ext
building 'pymqi.pymqe' extension
creating build\temp.win-amd64-3.6
creating build\temp.win-amd64-3.6\Release
creating build\temp.win-amd64-3.6\Release\pymqi
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\cl.exe /c /nologo /Ox /W3
/GL /DNDEBUG /MD -DPYQMI_SERVERBUILD=0 "-Ic:\Program Files (x86)\IBM\WebSphere MQ\tools\c\include
" -IC:\ProgramData\Anaconda3\include -IC:\ProgramData\Anaconda3\include "-IC:\Program Files (x86)
\Microsoft Visual Studio 14.0\VC\INCLUDE" "-IC:\Program Files (x86)\Microsoft Visual Studio 14.0\
VC\ATLMFC\INCLUDE" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.10150.0\ucrt" "-IC:\Pro
gram Files (x86)\Windows Kits\NETFXSDK\4.6\include\um" "-IC:\Program Files (x86)\Windows Kits\8.1
\include\shared" "-IC:\Program Files (x86)\Windows Kits\8.1\include\um" "-IC:\Program Files (x86)
\Windows Kits\8.1\include\winrt" "-IC:\Program Files\IBM\WebSphere MQ\tools\c\include" "-IC:\Prog
ram Files\IBM\WebSphere MQ\tools\cplus\include" /Tcpymqi/pymqe.c /Fobuild\temp.win-amd64-3.6\Rele
ase\pymqi/pymqe.obj
pymqe.c
pymqi/pymqe.c(249): warning C4013: 'PyString_AsString' undefined; assuming extern returning int
pymqi/pymqe.c(249): warning C4047: '=': 'MQPTR' differs in levels of indirection from 'int'
pymqi/pymqe.c(250): warning C4013: 'PyString_Size' undefined; assuming extern returning int
pymqi/pymqe.c(251): warning C4047: '=': 'MQPTR' differs in levels of indirection from 'int'
pymqi/pymqe.c(726): warning C4013: 'PyString_Check' undefined; assuming extern returning int
pymqi/pymqe.c(730): warning C4047: 'function': 'const char *' differs in levels of indirection
from 'int'
pymqi/pymqe.c(730): warning C4024: 'strncpy': different types for formal and actual parameter 2
pymqi/pymqe.c(1081): warning C4047: '=': 'char *' differs in levels of indirection from 'int'
pymqi/pymqe.c(1089): warning C4312: 'type cast': conversion from 'int' to 'PMQCHAR' of greater
size
pymqi/pymqe.c(1159): warning C4013: 'PyInt_Check' undefined; assuming extern returning int
pymqi/pymqe.c(1168): warning C4013: 'PyInt_AsLong' undefined; assuming extern returning int
pymqi/pymqe.c(1182): warning C4047: '=': 'MQCHAR *' differs in levels of indirection from 'int'
pymqi/pymqe.c(1190): warning C4312: 'type cast': conversion from 'int' to 'MQBYTE *' of greater
size
pymqi/pymqe.c(1391): warning C4013: 'PyString_FromString' undefined; assuming extern returning
int
pymqi/pymqe.c(1391): warning C4047: '=': 'PyObject *' differs in levels of indirection from 'in
t'
pymqi/pymqe.c(1454): warning C4013: 'PyString_FromStringAndSize' undefined; assuming extern ret
urning int
pymqi/pymqe.c(1454): warning C4047: '=': 'PyObject *' differs in levels of indirection from 'in
t'
pymqi/pymqe.c(1542): warning C4013: 'Py_InitModule4' undefined; assuming extern returning int
pymqi/pymqe.c(1544): warning C4047: '=': 'PyObject *' differs in levels of indirection from 'in
t'
pymqi/pymqe.c(1551): warning C4047: 'function': 'PyObject *' differs in levels of indirection f
rom 'int'
pymqi/pymqe.c(1551): warning C4024: 'PyDict_SetItemString': different types for formal and actu
al parameter 3
pymqi/pymqe.c(1552): warning C4047: 'function': 'PyObject *' differs in levels of indirection f
rom 'int'
pymqi/pymqe.c(1552): warning C4024: 'PyDict_SetItemString': different types for formal and actu
al parameter 3
pymqi/pymqe.c(1561): warning C4047: 'function': 'PyObject *' differs in levels of indirection f
rom 'int'
pymqi/pymqe.c(1561): warning C4024: 'PyList_Append': different types for formal and actual para
meter 2
pymqi/pymqe.c(1564): warning C4047: 'function': 'PyObject *' differs in levels of indirection f
rom 'int'
pymqi/pymqe.c(1564): warning C4024: 'PyList_Append': different types for formal and actual para
meter 2
pymqi/pymqe.c(1567): warning C4047: 'function': 'PyObject *' differs in levels of indirection f
rom 'int'
pymqi/pymqe.c(1567): warning C4024: 'PyList_Append': different types for formal and actual para
meter 2
pymqi/pymqe.c(1570): warning C4047: 'function': 'PyObject *' differs in levels of indirection f
rom 'int'
pymqi/pymqe.c(1570): warning C4024: 'PyList_Append': different types for formal and actual para
meter 2
pymqi/pymqe.c(1573): warning C4047: 'function': 'PyObject *' differs in levels of indirection f
rom 'int'
pymqi/pymqe.c(1573): warning C4024: 'PyList_Append': different types for formal and actual para
meter 2
pymqi/pymqe.c(1576): warning C4047: 'function': 'PyObject *' differs in levels of indirection f
rom 'int'
pymqi/pymqe.c(1576): warning C4024: 'PyList_Append': different types for formal and actual para
meter 2
pymqi/pymqe.c(1579): warning C4047: 'function': 'PyObject *' differs in levels of indirection f
rom 'int'
pymqi/pymqe.c(1579): warning C4024: 'PyList_Append': different types for formal and actual para
meter 2
pymqi/pymqe.c(1582): warning C4047: 'function': 'PyObject *' differs in levels of indirection f
rom 'int'
pymqi/pymqe.c(1582): warning C4024: 'PyList_Append': different types for formal and actual para
meter 2
pymqi/pymqe.c(1585): warning C4047: 'function': 'PyObject *' differs in levels of indirection f
rom 'int'
pymqi/pymqe.c(1585): warning C4024: 'PyList_Append': different types for formal and actual para
meter 2
pymqi/pymqe.c(1588): warning C4047: 'function': 'PyObject *' differs in levels of indirection f
rom 'int'
pymqi/pymqe.c(1588): warning C4024: 'PyList_Append': different types for formal and actual para
meter 2
pymqi/pymqe.c(1591): warning C4047: 'function': 'PyObject *' differs in levels of indirection f
rom 'int'
pymqi/pymqe.c(1591): warning C4024: 'PyList_Append': different types for formal and actual para
meter 2
pymqi/pymqe.c(1606): warning C4047: 'function': 'PyObject *' differs in levels of indirection f
rom 'int'
pymqi/pymqe.c(1606): warning C4024: 'PyDict_SetItemString': different types for formal and actu
al parameter 3
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\x86_amd64\link.exe /nologo /INCREMEN
TAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO "/LIBPATH:c:\Program Files (x86)\IBM\WebSp
here MQ\tools\Lib64" /LIBPATH:C:\ProgramData\Anaconda3\libs /LIBPATH:C:\ProgramData\Anaconda3\PCb
uild\amd64 "/LIBPATH:C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\LIB\amd64" "/LIBPATH:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\ATLMFC\LIB\amd64" "/LIBPATH:C:\Program Fil
es (x86)\Windows Kits\10\lib\10.0.10150.0\ucrt\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits
\NETFXSDK\4.6\lib\um\x64" "/LIBPATH:C:\Program Files (x86)\Windows Kits\8.1\lib\winv6.3\um\x64" "
/LIBPATH:C:\Program Files\IBM\WebSphere MQ\tools\lib64" "/LIBPATH:C:\Program Files\IBM\WebSphere
MQ\tools\lib" mqic.lib /EXPORT:PyInit_pymqe build\temp.win-amd64-3.6\Release\pymqi/pymqe.obj /OUT
:build\lib.win-amd64-3.6\pymqi\pymqe.cp36-win_amd64.pyd /IMPLIB:build\temp.win-amd64-3.6\Release\
pymqi\pymqe.cp36-win_amd64.lib
LINK : error LNK2001: unresolved external symbol PyInit_pymqe
build\temp.win-amd64-3.6\Release\pymqi\pymqe.cp36-win_amd64.lib : fatal error LNK1120: 1 unresolved externals
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\BIN\\x86_amd64\\link
.exe' failed with exit status 1120
出现此类问题的原因是什么?如何安装包?
我也尝试过setup.py安装,但由于安装原因我安装软件包的电脑没有Internet连接,因此手动安装所有软件包需要花费太多时间。
答案 0 :(得分:0)
我也遇到过这个问题。据我所知,这个版本的pymqi-1.7.2.tar.rz不适合python 3
安装py3mqi-1.6.0.tar.gz的版本