我正在尝试使用pip安装pcapy,但出现此错误
C:\Users\mshaik>pip install pcapy
Collecting pcapy
Using cached https://files.pythonhosted.org/packages/b0/68/b49e008f9e2b5ab727fb4b820c2e7d0914bd8dacb3c2d668a36b6e5d8991/pcapy-0.11.4.tar.gz
Building wheels for collected packages: pcapy
Running setup.py bdist_wheel for pcapy ... error
Complete output from command c:\tool\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\mshaik\\appdata\\local\\temp\\pip-install-tz7hmn\\pcapy\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d c:\users\mshaik\appdata\local\temp\pip-wheel-3vllr5 --python-tag cp27:
running bdist_wheel
running build
running build_ext
building 'pcapy' extension
creating build
creating build\temp.win-amd64-2.7
creating build\temp.win-amd64-2.7\Release
creating build\temp.win-amd64-2.7\Release\win32
C:\Users\mshaik\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DWIN32=1 -Ic:\wpdpack\Include -Ic:\tool\python27\include -Ic:\tool\python27\PC /Tppcapdumper.cc /Fobuild\temp.win-amd64-2.7\Release\pcapdumper.obj
pcapdumper.cc
C:\Users\mshaik\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DWIN32=1 -Ic:\wpdpack\Include -Ic:\tool\python27\include -Ic:\tool\python27\PC /Tpbpfobj.cc /Fobuild\temp.win-amd64-2.7\Release\bpfobj.obj
bpfobj.cc
C:\Users\mshaik\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DWIN32=1 -Ic:\wpdpack\Include -Ic:\tool\python27\include -Ic:\tool\python27\PC /Tppcapobj.cc /Fobuild\temp.win-amd64-2.7\Release\pcapobj.obj
pcapobj.cc
C:\Users\mshaik\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DWIN32=1 -Ic:\wpdpack\Include -Ic:\tool\python27\include -Ic:\tool\python27\PC /Tppcap_pkthdr.cc /Fobuild\temp.win-amd64-2.7\Release\pcap_pkthdr.obj
pcap_pkthdr.cc
C:\Users\mshaik\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DWIN32=1 -Ic:\wpdpack\Include -Ic:\tool\python27\include -Ic:\tool\python27\PC /Tppcapy.cc /Fobuild\temp.win-amd64-2.7\Release\pcapy.obj
pcapy.cc
C:\Users\mshaik\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DWIN32=1 -Ic:\wpdpack\Include -Ic:\tool\python27\include -Ic:\tool\python27\PC /Tpwin32\dllmain.cc /Fobuild\temp.win-amd64-2.7\Release\win32\dllmain.obj
dllmain.cc
creating build\lib.win-amd64-2.7
C:\Users\mshaik\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:c:\wpdpack\Lib\x64 /LIBPATH:c:\tool\python27\libs /LIBPATH:c:\tool\python27\PCbuild\amd64 /LIBPATH:c:\tool\python27\PC\VS9.0\amd64 wpcap.lib packet.lib ws2_32.lib /EXPORT:initpcapy build\temp.win-amd64-2.7\Release\pcapdumper.obj build\temp.win-amd64-2.7\Release\bpfobj.obj build\temp.win-amd64-2.7\Release\pcapobj.obj build\temp.win-amd64-2.7\Release\pcap_pkthdr.obj build\temp.win-amd64-2.7\Release\pcapy.obj build\temp.win-amd64-2.7\Release\win32\dllmain.obj /OUT:build\lib.win-amd64-2.7\pcapy.pyd /IMPLIB:build\temp.win-amd64-2.7\Release\pcapy.lib /MANIFESTFILE:build\temp.win-amd64-2.7\Release\pcapy.pyd.manifest
Creating library build\temp.win-amd64-2.7\Release\pcapy.lib and object build\temp.win-amd64-2.7\Release\pcapy.exp
pcapdumper.obj : error LNK2019: unresolved external symbol __imp__PyObject_Free referenced in function "void __cdecl pcap_dealloc(struct pcapdumper *)" (?pcap_dealloc@@YAXPAUpcapdumper@@@Z)
bpfobj.obj : error LNK2001: unresolved external symbol __imp__PyObject_Free
pcapobj.obj : error LNK2001: unresolved external symbol __imp__PyObject_Free
pcap_pkthdr.obj : error LNK2001: unresolved external symbol __imp__PyObject_Free
pcapdumper.obj : error LNK2019: unresolved external symbol __imp__Py_FindMethod referenced in function "struct _object * __cdecl pcap_getattr(struct pcapdumper *,char *)" (?pcap_getattr@@YAPAU_object@@PAUpcapdumper@@PAD@Z)
bpfobj.obj : error LNK2001: unresolved external symbol __imp__Py_FindMethod
pcapobj.obj : error LNK2001: unresolved external symbol __imp__Py_FindMethod
pcap_pkthdr.obj : error LNK2001: unresolved external symbol __imp__Py_FindMethod
pcapdumper.obj : error LNK2019: unresolved external symbol __imp___PyObject_New referenced in function "struct _object * __cdecl new_pcapdumper(struct pcap_dumper *)" (?new_pcapdumper@@YAPAU_object@@PAUpcap_dumper@@@Z)
bpfobj.obj : error LNK2001: unresolved external symbol __imp___PyObject_New
pcapobj.obj : error LNK2001: unresolved external symbol __imp___PyObject_New
pcap_pkthdr.obj : error LNK2001: unresolved external symbol __imp___PyObject_New
pcapy.obj : error LNK2001: unresolved external symbol __imp__PyType_Ready
pcapdumper.obj : error LNK2019: unresolved external symbol __imp__PyType_Ready referenced in function "struct _object * __cdecl new_pcapdumper(struct pcap_dumper *)" (?new_pcapdumper@@YAPAU_object@@PAUpcap_dumper@@@Z)
bpfobj.obj : error LNK2001: unresolved external symbol __imp__PyType_Ready
pcapobj.obj : error LNK2001: unresolved external symbol __imp__PyType_Ready
pcap_pkthdr.obj : error LNK2001: unresolved external symbol __imp__PyType_Ready
pcapy.obj : error LNK2019: unresolved external symbol __imp__PyErr_SetString referenced in function _initpcapy
pcapdumper.obj : error LNK2001: unresolved external symbol __imp__PyErr_SetString
bpfobj.obj : error LNK2001: unresolved external symbol __imp__PyErr_SetString
pcapobj.obj : error LNK2001: unresolved external symbol __imp__PyErr_SetString
pcap_pkthdr.obj : error LNK2001: unresolved external symbol __imp__PyErr_SetString
pcapdumper.obj : error LNK2019: unresolved external symbol __imp___Py_NoneStruct referenced in function "struct _object * __cdecl p_dump(struct pcapdumper *,struct _object *)" (?p_dump@@YAPAU_object@@PAUpcapdumper@@PAU1@@Z)
pcapobj.obj : error LNK2001: unresolved external symbol __imp___Py_NoneStruct
pcapdumper.obj : error LNK2019: unresolved external symbol __imp__PyArg_ParseTuple referenced in function "struct _object * __cdecl p_dump(struct pcapdumper *,struct _object *)" (?p_dump@@YAPAU_object@@PAUpcapdumper@@PAU1@@Z)
bpfobj.obj : error LNK2001: unresolved external symbol __imp__PyArg_ParseTuple
pcapobj.obj : error LNK2001: unresolved external symbol __imp__PyArg_ParseTuple
pcapy.obj : error LNK2001: unresolved external symbol __imp__PyArg_ParseTuple
bpfobj.obj : error LNK2019: unresolved external symbol __imp__Py_BuildValue referenced in function "struct _object * __cdecl p_filter(struct bpfobject *,struct _object *)" (?p_filter@@YAPAU_object@@PAUbpfobject@@PAU1@@Z)
pcapobj.obj : error LNK2001: unresolved external symbol __imp__Py_BuildValue
pcap_pkthdr.obj : error LNK2001: unresolved external symbol __imp__Py_BuildValue
pcapy.obj : error LNK2001: unresolved external symbol __imp__Py_BuildValue
bpfobj.obj : error LNK2019: unresolved external symbol __imp__PyList_New referenced in function "struct _object * __cdecl p_get_bpf(struct bpfobject *,struct _object *)" (?p_get_bpf@@YAPAU_object@@PAUbpfobject@@PAU1@@Z)
pcapy.obj : error LNK2001: unresolved external symbol __imp__PyList_New
pcapobj.obj : error LNK2019: unresolved external symbol __imp__PyExc_ValueError referenced in function "struct _object * __cdecl err_closed(void)" (?err_closed@@YAPAU_object@@XZ)
pcapobj.obj : error LNK2019: unresolved external symbol __imp__PyEval_RestoreThread referenced in function "struct _object * __cdecl p_next(struct pcapobject *,struct _object *)" (?p_next@@YAPAU_object@@PAUpcapobject@@PAU1@@Z)
pcapobj.obj : error LNK2019: unresolved external symbol __imp__PyEval_SaveThread referenced in function "struct _object * __cdecl p_next(struct pcapobject *,struct _object *)" (?p_next@@YAPAU_object@@PAUpcapobject@@PAU1@@Z)
pcapobj.obj : error LNK2019: unresolved external symbol __imp__PyEval_CallObjectWithKeywords referenced in function "void __cdecl PythonCallBack(unsigned char *,struct pcap_pkthdr const *,unsigned char const *)" (?PythonCallBack@@YAXPAEPBUpcap_pkthdr@@PBE@Z)
pcapobj.obj : error LNK2019: unresolved external symbol __imp__PyThreadState_Get referenced in function "struct _object * __cdecl p_dispatch(struct pcapobject *,struct _object *)" (?p_dispatch@@YAPAU_object@@PAUpcapobject@@PAU1@@Z)
pcapy.obj : error LNK2019: unresolved external symbol __imp__PyList_Append referenced in function "struct _object * __cdecl findalldevs(struct _object *,struct _object *)" (?findalldevs@@YAPAU_object@@PAU1@0@Z)
pcapy.obj : error LNK2019: unresolved external symbol __imp__PyDict_SetItemString referenced in function _initpcapy
pcapy.obj : error LNK2019: unresolved external symbol __imp__PyErr_NewException referenced in function _initpcapy
pcapy.obj : error LNK2019: unresolved external symbol __imp__PyModule_GetDict referenced in function _initpcapy
pcapy.obj : error LNK2019: unresolved external symbol __imp__PyModule_AddIntConstant referenced in function _initpcapy
pcapy.obj : error LNK2019: unresolved external symbol __imp__PyModule_AddObject referenced in function _initpcapy
pcapy.obj : error LNK2019: unresolved external symbol __imp__Py_InitModule4 referenced in function _initpcapy
pcapy.obj : error LNK2019: unresolved external symbol __imp__PyType_Type referenced in function _initpcapy
build\lib.win-amd64-2.7\pcapy.pyd : fatal error LNK1120: 22 unresolved externals
error: command 'C:\\Users\\mshaik\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\link.exe' failed with exit status 1120
Running setup.py clean for pcapy
Failed to build pcapy
Installing collected packages: pcapy
Running setup.py install for pcapy ... error
Complete output from command c:\tool\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\mshaik\\appdata\\local\\temp\\pip-install-tz7hmn\\pcapy\\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\mshaik\appdata\local\temp\pip-record-s5f0rz\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
building 'pcapy' extension
creating build
creating build\temp.win-amd64-2.7
creating build\temp.win-amd64-2.7\Release
creating build\temp.win-amd64-2.7\Release\win32
C:\Users\mshaik\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DWIN32=1 -Ic:\wpdpack\Include -Ic:\tool\python27\include -Ic:\tool\python27\PC /Tppcapdumper.cc /Fobuild\temp.win-amd64-2.7\Release\pcapdumper.obj
pcapdumper.cc
C:\Users\mshaik\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DWIN32=1 -Ic:\wpdpack\Include -Ic:\tool\python27\include -Ic:\tool\python27\PC /Tpbpfobj.cc /Fobuild\temp.win-amd64-2.7\Release\bpfobj.obj
bpfobj.cc
C:\Users\mshaik\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DWIN32=1 -Ic:\wpdpack\Include -Ic:\tool\python27\include -Ic:\tool\python27\PC /Tppcapobj.cc /Fobuild\temp.win-amd64-2.7\Release\pcapobj.obj
pcapobj.cc
C:\Users\mshaik\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DWIN32=1 -Ic:\wpdpack\Include -Ic:\tool\python27\include -Ic:\tool\python27\PC /Tppcap_pkthdr.cc /Fobuild\temp.win-amd64-2.7\Release\pcap_pkthdr.obj
pcap_pkthdr.cc
C:\Users\mshaik\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DWIN32=1 -Ic:\wpdpack\Include -Ic:\tool\python27\include -Ic:\tool\python27\PC /Tppcapy.cc /Fobuild\temp.win-amd64-2.7\Release\pcapy.obj
pcapy.cc
C:\Users\mshaik\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DWIN32=1 -Ic:\wpdpack\Include -Ic:\tool\python27\include -Ic:\tool\python27\PC /Tpwin32\dllmain.cc /Fobuild\temp.win-amd64-2.7\Release\win32\dllmain.obj`enter code here`
dllmain.cc
creating build\lib.win-amd64-2.7
C:\Users\mshaik\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\link.exe /DLL /nologo /INCREMENTAL:NO /LIBPATH:c:\wpdpack\Lib\x64 /LIBPATH:c:\tool\python27\libs /LIBPATH:c:\tool\python27\PCbuild\amd64 /LIBPATH:c:\tool\python27\PC\VS9.0\amd64 wpcap.lib packet.lib ws2_32.lib /EXPORT:initpcapy build\temp.win-amd64-2.7\Release\pcapdumper.obj build\temp.win-amd64-2.7\Release\bpfobj.obj build\temp.win-amd64-2.7\Release\pcapobj.obj build\temp.win-amd64-2.7\Release\pcap_pkthdr.obj build\temp.win-amd64-2.7\Release\pcapy.obj build\temp.win-amd64-2.7\Release\win32\dllmain.obj /OUT:build\lib.win-amd64-2.7\pcapy.pyd /IMPLIB:build\temp.win-amd64-2.7\Release\pcapy.lib /MANIFESTFILE:build\temp.win-amd64-2.7\Release\pcapy.pyd.manifest
Creating library build\temp.win-amd64-2.7\Release\pcapy.lib and object build\temp.win-amd64-2.7\Release\pcapy.exp
pcapdumper.obj : error LNK2019: unresolved external symbol __imp__PyObject_Free referenced in function "void __cdecl pcap_dealloc(struct pcapdumper *)" (?pcap_dealloc@@YAXPAUpcapdumper@@@Z)
bpfobj.obj : error LNK2001: unresolved external symbol __imp__PyObject_Free
pcapobj.obj : error LNK2001: unresolved external symbol __imp__PyObject_Free
pcap_pkthdr.obj : error LNK2001: unresolved external symbol __imp__PyObject_Free
pcapdumper.obj : error LNK2019: unresolved external symbol __imp__Py_FindMethod referenced in function "struct _object * __cdecl pcap_getattr(struct pcapdumper *,char *)" (?pcap_getattr@@YAPAU_object@@PAUpcapdumper@@PAD@Z)
bpfobj.obj : error LNK2001: unresolved external symbol __imp__Py_FindMethod
pcapobj.obj : error LNK2001: unresolved external symbol __imp__Py_FindMethod
pcap_pkthdr.obj : error LNK2001: unresolved external symbol __imp__Py_FindMethod
pcapdumper.obj : error LNK2019: unresolved external symbol __imp___PyObject_New referenced in function "struct _object * __cdecl new_pcapdumper(struct pcap_dumper *)" (?new_pcapdumper@@YAPAU_object@@PAUpcap_dumper@@@Z)
bpfobj.obj : error LNK2001: unresolved external symbol __imp___PyObject_New
pcapobj.obj : error LNK2001: unresolved external symbol __imp___PyObject_New
pcap_pkthdr.obj : error LNK2001: unresolved external symbol __imp___PyObject_New
pcapy.obj : error LNK2001: unresolved external symbol __imp__PyType_Ready
pcapdumper.obj : error LNK2019: unresolved external symbol __imp__PyType_Ready referenced in function "struct _object * __cdecl new_pcapdumper(struct pcap_dumper *)" (?new_pcapdumper@@YAPAU_object@@PAUpcap_dumper@@@Z)
bpfobj.obj : error LNK2001: unresolved external symbol __imp__PyType_Ready
pcapobj.obj : error LNK2001: unresolved external symbol __imp__PyType_Ready
pcap_pkthdr.obj : error LNK2001: unresolved external symbol __imp__PyType_Ready
pcapy.obj : error LNK2019: unresolved external symbol __imp__PyErr_SetString referenced in function _initpcapy
pcapdumper.obj : error LNK2001: unresolved external symbol __imp__PyErr_SetString
bpfobj.obj : error LNK2001: unresolved external symbol __imp__PyErr_SetString
pcapobj.obj : error LNK2001: unresolved external symbol __imp__PyErr_SetString
pcap_pkthdr.obj : error LNK2001: unresolved external symbol __imp__PyErr_SetString
pcapdumper.obj : error LNK2019: unresolved external symbol __imp___Py_NoneStruct referenced in function "struct _object * __cdecl p_dump(struct pcapdumper *,struct _object *)" (?p_dump@@YAPAU_object@@PAUpcapdumper@@PAU1@@Z)
pcapobj.obj : error LNK2001: unresolved external symbol __imp___Py_NoneStruct
pcapdumper.obj : error LNK2019: unresolved external symbol __imp__PyArg_ParseTuple referenced in function "struct _object * __cdecl p_dump(struct pcapdumper *,struct _object *)" (?p_dump@@YAPAU_object@@PAUpcapdumper@@PAU1@@Z)
bpfobj.obj : error LNK2001: unresolved external symbol __imp__PyArg_ParseTuple
pcapobj.obj : error LNK2001: unresolved external symbol __imp__PyArg_ParseTuple
pcapy.obj : error LNK2001: unresolved external symbol __imp__PyArg_ParseTuple
bpfobj.obj : error LNK2019: unresolved external symbol __imp__Py_BuildValue referenced in function "struct _object * __cdecl p_filter(struct bpfobject *,struct _object *)" (?p_filter@@YAPAU_object@@PAUbpfobject@@PAU1@@Z)
pcapobj.obj : error LNK2001: unresolved external symbol __imp__Py_BuildValue
pcap_pkthdr.obj : error LNK2001: unresolved external symbol __imp__Py_BuildValue
pcapy.obj : error LNK2001: unresolved external symbol __imp__Py_BuildValue
bpfobj.obj : error LNK2019: unresolved external symbol __imp__PyList_New referenced in function "struct _object * __cdecl p_get_bpf(struct bpfobject *,struct _object *)" (?p_get_bpf@@YAPAU_object@@PAUbpfobject@@PAU1@@Z)
pcapy.obj : error LNK2001: unresolved external symbol __imp__PyList_New
pcapobj.obj : error LNK2019: unresolved external symbol __imp__PyExc_ValueError referenced in function "struct _object * __cdecl err_closed(void)" (?err_closed@@YAPAU_object@@XZ)
pcapobj.obj : error LNK2019: unresolved external symbol __imp__PyEval_RestoreThread referenced in function "struct _object * __cdecl p_next(struct pcapobject *,struct _object *)" (?p_next@@YAPAU_object@@PAUpcapobject@@PAU1@@Z)
pcapobj.obj : error LNK2019: unresolved external symbol __imp__PyEval_SaveThread referenced in function "struct _object * __cdecl p_next(struct pcapobject *,struct _object *)" (?p_next@@YAPAU_object@@PAUpcapobject@@PAU1@@Z)
pcapobj.obj : error LNK2019: unresolved external symbol __imp__PyEval_CallObjectWithKeywords referenced in function "void __cdecl PythonCallBack(unsigned char *,struct pcap_pkthdr const *,unsigned char const *)" (?PythonCallBack@@YAXPAEPBUpcap_pkthdr@@PBE@Z)
pcapobj.obj : error LNK2019: unresolved external symbol __imp__PyThreadState_Get referenced in function "struct _object * __cdecl p_dispatch(struct pcapobject *,struct _object *)" (?p_dispatch@@YAPAU_object@@PAUpcapobject@@PAU1@@Z)
pcapy.obj : error LNK2019: unresolved external symbol __imp__PyList_Append referenced in function "struct _object * __cdecl findalldevs(struct _object *,struct _object *)" (?findalldevs@@YAPAU_object@@PAU1@0@Z)
pcapy.obj : error LNK2019: unresolved external symbol __imp__PyDict_SetItemString referenced in function _initpcapy
pcapy.obj : error LNK2019: unresolved external symbol __imp__PyErr_NewException referenced in function _initpcapy
pcapy.obj : error LNK2019: unresolved external symbol __imp__PyModule_GetDict referenced in function _initpcapy
pcapy.obj : error LNK2019: unresolved external symbol __imp__PyModule_AddIntConstant referenced in function _initpcapy
pcapy.obj : error LNK2019: unresolved external symbol __imp__PyModule_AddObject referenced in function _initpcapy
pcapy.obj : error LNK2019: unresolved external symbol __imp__Py_InitModule4 referenced in function _initpcapy
pcapy.obj : error LNK2019: unresolved external symbol __imp__PyType_Type referenced in function _initpcapy
build\lib.win-amd64-2.7\pcapy.pyd : fatal error LNK1120: 22 unresolved externals
error: command 'C:\\Users\\mshaik\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\link.exe' failed with exit status 1120
我只是过去3天的抓挠头。
任何建议都会非常有用!
答案 0 :(得分:0)