visuelt studie - Python-modulet 'psutil' mislykkedes at bygge på Windows 7 + VS2008SP1 miljø

Indlæg af Hanne Mølgaard Plasc

Problem



Jeg satte op VS 2008 SP1 på Windows 7 (64-bit) og forsøgte at bygge psutilen, fik følgende fejl. VS 2008 er korrekt konfigureret og med SP1 korrekt patched.


Jeg kørte kommandoen 'python setup.py build' pr. INSTALL-filen i pakken.


c:srcpsutil>python setup.py build --verbose
running build
running build\_py
running build\_ext
building '\_psutil\_mswindows' extension
c:Program Files (x86)Microsoft Visual Studio 9.0VCBINlink.exe /DLL /nologo
/INCREMENTAL:NO /LIBPATH:C:python\_26\_amd64fileslibs /LIBPATH:C:python\_26\_amd
64filesPCbuildamd64 psapi.lib kernel32.lib advapi32.lib shell32.lib netapi32.
lib iphlpapi.lib /EXPORT:init\_psutil\_mswindows build	emp.win-amd64-2.6Release
psutil/\_psutil\_mswindows.obj build	emp.win-amd64-2.6Releasepsutil/\_psutil\_com
mon.obj build	emp.win-amd64-2.6Releasepsutil/arch/mswindows/process\_info.obj
build	emp.win-amd64-2.6Releasepsutil/arch/mswindows/process\_handles.obj build
	emp.win-amd64-2.6Releasepsutil/arch/mswindows/security.obj /OUT:buildlib.wi
n-amd64-2.6\_psutil\_mswindows.pyd /IMPLIB:build	emp.win-amd64-2.6Releasepsuti
l\_psutil\_mswindows.lib /MANIFESTFILE:build	emp.win-amd64-2.6Releasepsutil\_p
sutil\_mswindows.pyd.manifest
   Creating library build	emp.win-amd64-2.6Releasepsutil\_psutil\_mswindows.lib and object build	emp.win-amd64-2.6Releasepsutil\_psutil\_mswindows.exp\_psutil\_mswindows.obj : error LNK2019: unresolved external symbol \_\_imp\_\_Py\_BuildValue referenced in function \_get\_system\_uptime
process\_info.obj : error LNK2001: unresolved external symbol \_\_imp\_\_Py\_BuildValue
process\_handles.obj : error LNK2001: unresolved external symbol \_\_imp\_\_Py\_BuildValue
\_psutil\_mswindows.obj : error LNK2019: unresolved external symbol \_\_imp\_\_PyBool\_FromLong referenced in function \_pid\_exists
\_psutil\_mswindows.obj : error LNK2019: unresolved external symbol \_\_imp\_\_PyArg\_ParseTuple referenced in function \_pid\_exists
\_psutil\_mswindows.obj : error LNK2019: unresolved external symbol \_\_imp\_\_PyList\_Append referenced in function \_get\_pid\_list
process\_info.obj : error LNK2001: unresolved external symbol \_\_imp\_\_PyList\_Append
process\_handles.obj : error LNK2001: unresolved external symbol \_\_imp\_\_PyList\_Append
\_psutil\_mswindows.obj : error LNK2019: unresolved external symbol \_\_imp\_\_PyList\_New referenced in function \_get\_pid\_list\_psutil\_mswindows.obj : error LNK2019: unresolved external symbol \_\_imp\_\_\_Py\_NoneStruct referenced in function \_kill\_process
\_psutil\_mswindows.obj : error LNK2019: unresolved external symbol \_\_imp\_\_PyErr\_SetFromWindowsErr referenced in function \_kill\_process
process\_info.obj : error LNK2001: unresolved external symbol \_\_imp\_\_PyErr\_SetFromWindowsErr
security.obj : error LNK2001: unresolved external symbol \_\_imp\_\_PyErr\_SetFromWindowsErr
\_psutil\_mswindows.obj : error LNK2019: unresolved external symbol \_\_imp\_\_PyInt\_FromLong referenced in function \_process\_wait
\_psutil\_mswindows.obj : error LNK2019: unresolved external symbol \_\_imp\_\_PyEval\_RestoreThread referenced in function \_process\_wait
\_psutil\_mswindows.obj : error LNK2019: unresolved external symbol \_\_imp\_\_PyEval\_SaveThread referenced in function \_process\_wait
\_psutil\_mswindows.obj : error LNK2019: unresolved external symbol \_\_imp\_\_PyErr\_Clear referenced in function \_get\_process\_cmdline
\_psutil\_mswindows.obj : error LNK2019: unresolved external symbol \_\_imp\_\_PyUnicodeUCS2\_AsUTF8String referenced in function \_get\_process\_cwd
process\_info.obj : error LNK2001: unresolved external symbol \_\_imp\_\_PyUnicodeUCS2\_AsUTF8String
\_psutil\_mswindows.obj : error LNK2019: unresolved external symbol \_\_imp\_\_PyUnicodeUCS2\_FromWideChar referenced in function \_get\_process\_cwd
process\_info.obj : error LNK2001: unresolved external symbol \_\_imp\_\_PyUnicodeUCS
2\_FromWideChar
process\_handles.obj : error LNK2001: unresolved external symbol \_\_imp\_\_PyUnicodeUCS2\_FromWideChar
\_psutil\_mswindows.obj : error LNK2019: unresolved external symbol \_\_imp\_\_PyExc\_TypeError referenced in function \_get\_process\_connections
\_psutil\_mswindows.obj : error LNK2019: unresolved external symbol \_\_imp\_\_PyErr\_SetString referenced in function \_get\_process\_connections
\_psutil\_mswindows.obj : error LNK2019: unresolved external symbol \_\_imp\_\_PyExc\_NotImplementedError referenced in function \_get\_process\_connections
\_psutil\_mswindows.obj : error LNK2019: unresolved external symbol \_\_imp\_\_PyTuple\_New referenced in function \_get\_process\_connections
\_psutil\_mswindows.obj : error LNK2019: unresolved external symbol \_\_imp\_\_PySequence\_Contains referenced in function \_get\_process\_connections
\_psutil\_mswindows.obj : error LNK2019: unresolved external symbol \_\_imp\_\_PySequence\_Check referenced in function \_get\_process\_connections
\_psutil\_mswindows.obj : error LNK2019: unresolved external symbol \_\_imp\_\_PyLong\_FromLong referenced in function \_get\_process\_connections
\_psutil\_mswindows.obj : error LNK2019: unresolved external symbol \_\_imp\_\_\_Py\_ZeroStruct referenced in function \_is\_process\_suspended
\_psutil\_mswindows.obj : error LNK2019: unresolved external symbol \_\_imp\_\_\_Py\_TrueStruct referenced in function \_is\_process\_suspended
\_psutil\_mswindows.obj : error LNK2019: unresolved external symbol \_\_imp\_\_PyDict\_SetItem referenced in function \_get\_network\_io\_counters
\_psutil\_mswindows.obj : error LNK2019: unresolved external symbol \_\_imp\_\_PyUnicodeUCS2\_FromObject referenced in function \_get\_network\_io\_counters
process\_info.obj : error LNK2001: unresolved external symbol \_\_imp\_\_PyUnicodeUCS2\_FromObject
process\_handles.obj : error LNK2001: unresolved external symbol \_\_imp\_\_PyUnicodeUCS2\_FromObject
\_psutil\_mswindows.obj : error LNK2019: unresolved external symbol \_\_imp\_\_PyExc\_RuntimeError referenced in function \_get\_network\_io\_counters
process\_info.obj : error LNK2001: unresolved external symbol \_\_imp\_\_PyExc\_RuntimeError
\_psutil\_mswindows.obj : error LNK2019: unresolved external symbol \_\_imp\_\_PyDict\_New referenced in function \_get\_network\_io\_counters
\_psutil\_mswindows.obj : error LNK2019: unresolved external symbol \_\_imp\_\_PyDict\_SetItemString referenced in function \_get\_disk\_io\_counters
\_psutil\_mswindows.obj : error LNK2019: unresolved external symbol \_\_imp\_\_PyModule\_AddIntConstant referenced in function \_init\_psutil\_mswindows
\_psutil\_mswindows.obj : error LNK2019: unresolved external symbol \_\_imp\_\_PyErr\_NewException referenced in function \_init\_psutil\_mswindows
\_psutil\_mswindows.obj : error LNK2019: unresolved external symbol \_\_imp\_\_Py\_InitModule4 referenced in function \_init\_psutil\_mswindows
\_psutil\_common.obj : error LNK2019: unresolved external symbol \_\_imp\_\_PyErr\_SetObject referenced in function \_NoSuchProcess
\_psutil\_common.obj : error LNK2019: unresolved external symbol \_\_imp\_\_PyObject\_CallFunction referenced in function \_NoSuchProcess
\_psutil\_common.obj : error LNK2019: unresolved external symbol \_\_imp\_\_PyExc\_OSError referenced in function \_NoSuchProcess
process\_info.obj : error LNK2019: unresolved external symbol \_\_imp\_\_PyErr\_Format referenced in function \_get\_process\_info
buildlib.win-amd64-2.6\_psutil\_mswindows.pyd : fatal error LNK1120: 34 unresolved externals
error: command '"c:Program Files (x86)Microsoft Visual Studio 9.0VCBINlink.exe"' failed with exit status 1120


Eventuelle ideer som bibliotek mangler i standard distutils config? Hvordan kan jeg med succes opbygge psutil i mit miljø?

Bedste reference


Til gavn for andre mennesker med det samme problem: Sørg for at bruge kommandoprompten til Visual Studio x64 til at starte installationsskriptet.