python pymqi安装期间未解决的外部问题

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python pymqi安装期间未解决的外部问题相关的知识,希望对你有一定的参考价值。

我在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:ProgramDataAnaconda3python.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('
', '
');f.close();exec(compile(cod
e, __file__, 'exec'))" bdist_wheel -d C:UsersELYASH~1AppDataLocalTemp	mp4f_xo1yupip-wheel-
--python-tag cp36:
  Building PyMQI client 64bits
  running bdist_wheel
  running build
  running build_py
  creating build
  creating buildlib.win-amd64-3.6
  creating buildlib.win-amd64-3.6pymqi
  copying pymqi\__init__.py -> buildlib.win-amd64-3.6pymqi
  copying pymqiCMQC.py -> buildlib.win-amd64-3.6pymqi
  copying pymqiCMQCFC.py -> buildlib.win-amd64-3.6pymqi
  copying pymqiCMQXC.py -> buildlib.win-amd64-3.6pymqi
  copying pymqiCMQZC.py -> buildlib.win-amd64-3.6pymqi
  running build_ext
  building 'pymqi.pymqe' extension
  creating build	emp.win-amd64-3.6
  creating build	emp.win-amd64-3.6Release
  creating build	emp.win-amd64-3.6Releasepymqi
  C:Program Files (x86)Microsoft Visual Studio 14.0VCBINx86_amd64cl.exe /c /nologo /Ox /W3
/GL /DNDEBUG /MD -DPYQMI_SERVERBUILD=0 "-Ic:Program Files (x86)IBMWebSphere MQ	oolscinclude
" -IC:ProgramDataAnaconda3include -IC:ProgramDataAnaconda3include "-IC:Program Files (x86)
Microsoft Visual Studio 14.0VCINCLUDE" "-IC:Program Files (x86)Microsoft Visual Studio 14.0
VCATLMFCINCLUDE" "-IC:Program Files (x86)Windows Kits10include10.0.10150.0ucrt" "-IC:Pro
gram Files (x86)Windows KitsNETFXSDK4.6includeum" "-IC:Program Files (x86)Windows Kits8.1
includeshared" "-IC:Program Files (x86)Windows Kits8.1includeum" "-IC:Program Files (x86)
Windows Kits8.1includewinrt" "-IC:Program FilesIBMWebSphere MQ	oolscinclude" "-IC:Prog
ram FilesIBMWebSphere MQ	oolscplusinclude" /Tcpymqi/pymqe.c /Fobuild	emp.win-amd64-3.6Rele
asepymqi/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.0VCBINx86_amd64link.exe /nologo /INCREMEN
TAL:NO /LTCG /DLL /MANIFEST:EMBED,ID=2 /MANIFESTUAC:NO "/LIBPATH:c:Program Files (x86)IBMWebSp
here MQ	oolsLib64" /LIBPATH:C:ProgramDataAnaconda3libs /LIBPATH:C:ProgramDataAnaconda3PCb
uildamd64 "/LIBPATH:C:Program Files (x86)Microsoft Visual Studio 14.0VCLIBamd64" "/LIBPATH:
C:Program Files (x86)Microsoft Visual Studio 14.0VCATLMFCLIBamd64" "/LIBPATH:C:Program Fil
es (x86)Windows Kits10lib10.0.10150.0ucrtx64" "/LIBPATH:C:Program Files (x86)Windows Kits
NETFXSDK4.6libumx64" "/LIBPATH:C:Program Files (x86)Windows Kits8.1libwinv6.3umx64" "
/LIBPATH:C:Program FilesIBMWebSphere MQ	oolslib64" "/LIBPATH:C:Program FilesIBMWebSphere
MQ	oolslib" mqic.lib /EXPORT:PyInit_pymqe build	emp.win-amd64-3.6Releasepymqi/pymqe.obj /OUT
:buildlib.win-amd64-3.6pymqipymqe.cp36-win_amd64.pyd /IMPLIB:build	emp.win-amd64-3.6Release
pymqipymqe.cp36-win_amd64.lib
  LINK : error LNK2001: unresolved external symbol PyInit_pymqe
  build	emp.win-amd64-3.6Releasepymqipymqe.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连接,因此手动安装所有软件包需要花费太多时间。

答案

我也遇到过这个问题。据我所知,这个版本的pymqi-1.7.2.tar.rz不适合python 3

安装py3mqi-1.6.0.tar.gz的版本

以上是关于python pymqi安装期间未解决的外部问题的主要内容,如果未能解决你的问题,请参考以下文章

Python嵌入项目中的VC ++ 6“未解决的外部”

使用Boost.Python修复未解析的外部符号

如何使用`python setup.py build`解决C ++ / C编译期间的“冲突类型”错误?

gsl_rng_default 未解决的外部错误

Anaconda安装Python,提示Python不是内部或外部命令解决方法

外部表不是预期的格式。未安装 MS Office。使用 C# 创建 xlsx 文件