简体   繁体   中英

Error when installing psutil module - [Windows pypy 2.7]

Trying to install module "psutil"

I'm usting Windows 10 and pypy 2.7 version

https://pypy.org/download.html

pypy -m pip install psutil


DEPRECATION: A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting psutil
  Using cached https://files.pythonhosted.org/packages/1c/ca/5b8c1fe032a458c2c4bcbe509d1401dca9dda35c7fc46b36bb81c2834740/psutil-5.6.3.tar.gz
Installing collected packages: psutil
  Running setup.py install for psutil ... error
    ERROR: Command errored out with exit status 1:
     command: 'C:\Program Files (x86)\pypy2.7-v7.1.1-win32\pypy.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'c:\\users\\public\\documents\\wondershare\\creatortemp\\pip-install-orbh2p\\psutil\\setup.py'"'"'; __file__='"'"'c:\\users\\public\\documents\\wondershare\\creatortemp\\pip-install-orbh2p\\psutil\\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\public\documents\wondershare\creatortemp\pip-record-58j8zq\install-record.txt' --single-version-externally-managed --compile
         cwd: c:\users\public\documents\wondershare\creatortemp\pip-install-orbh2p\psutil\
    Complete output (49 lines):
    running install
    running build
    running build_py
    creating build
    creating build\lib.win32-2.7
    creating build\lib.win32-2.7\psutil
    copying psutil\_common.py -> build\lib.win32-2.7\psutil
    copying psutil\_compat.py -> build\lib.win32-2.7\psutil
    copying psutil\_psaix.py -> build\lib.win32-2.7\psutil
    copying psutil\_psbsd.py -> build\lib.win32-2.7\psutil
    copying psutil\_pslinux.py -> build\lib.win32-2.7\psutil
    copying psutil\_psosx.py -> build\lib.win32-2.7\psutil
    copying psutil\_psposix.py -> build\lib.win32-2.7\psutil
    copying psutil\_pssunos.py -> build\lib.win32-2.7\psutil
    copying psutil\_pswindows.py -> build\lib.win32-2.7\psutil
    copying psutil\__init__.py -> build\lib.win32-2.7\psutil
    creating build\lib.win32-2.7\psutil\tests
    copying psutil\tests\runner.py -> build\lib.win32-2.7\psutil\tests
    copying psutil\tests\test_aix.py -> build\lib.win32-2.7\psutil\tests
    copying psutil\tests\test_bsd.py -> build\lib.win32-2.7\psutil\tests
    copying psutil\tests\test_connections.py -> build\lib.win32-2.7\psutil\tests
    copying psutil\tests\test_contracts.py -> build\lib.win32-2.7\psutil\tests
    copying psutil\tests\test_linux.py -> build\lib.win32-2.7\psutil\tests
    copying psutil\tests\test_memory_leaks.py -> build\lib.win32-2.7\psutil\tests
    copying psutil\tests\test_misc.py -> build\lib.win32-2.7\psutil\tests
    copying psutil\tests\test_osx.py -> build\lib.win32-2.7\psutil\tests
    copying psutil\tests\test_posix.py -> build\lib.win32-2.7\psutil\tests
    copying psutil\tests\test_process.py -> build\lib.win32-2.7\psutil\tests
    copying psutil\tests\test_sunos.py -> build\lib.win32-2.7\psutil\tests
    copying psutil\tests\test_system.py -> build\lib.win32-2.7\psutil\tests
    copying psutil\tests\test_unicode.py -> build\lib.win32-2.7\psutil\tests
    copying psutil\tests\test_windows.py -> build\lib.win32-2.7\psutil\tests
    copying psutil\tests\__init__.py -> build\lib.win32-2.7\psutil\tests
    copying psutil\tests\__main__.py -> build\lib.win32-2.7\psutil\tests
    running build_ext
    building 'psutil._psutil_windows' extension
    creating build\temp.win32-2.7
    creating build\temp.win32-2.7\Release
    creating build\temp.win32-2.7\Release\psutil
    creating build\temp.win32-2.7\Release\psutil\arch
    creating build\temp.win32-2.7\Release\psutil\arch\windows
    C:\Users\xxx\AppData\Local\Programs\Common\Microsoft\Visual C++ for Python\9.0\VC\Bin\cl.exe /c /nologo /Ox /MD /W3 /GS- /DNDEBUG -DPSUTIL_VERSION=563 -DPSUTIL_WINDOWS=1 -D_WIN32_WINNT=0x0602 -D_AVAIL_WINVER_=0x0602 -D_CRT_SECURE_NO_WARNINGS -DPSAPI_VERSION=1 -IC:\Program Files (x86)\pypy2.7-v7.1.1-win32\include /Tcpsutil/_psutil_common.c /Fobuild\temp.win32-2.7\Release\psutil/_psutil_common.obj
    _psutil_common.c
    psutil/_psutil_common.c(49) : error C2065: 'ESRCH' : undeclared identifier
    psutil/_psutil_common.c(49) : error C2065: 'ESRCH' : undeclared identifier
    psutil/_psutil_common.c(66) : warning C4013: 'PyErr_SetFromWindowsErrWithFilename' undefined; assuming extern returning int
    psutil/_psutil_common.c(86) : error C2065: 'EACCES' : undeclared identifier
    psutil/_psutil_common.c(86) : error C2065: 'EACCES' : undeclared identifier
    error: command 'C:\\Users\\xxx\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\cl.exe' failed with exit status 2
    ----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Program Files (x86)\pypy2.7-v7.1.1-win32\pypy.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'c:\\users\\public\\documents\\wondershare\\creatortemp\\pip-install-orbh2p\\psutil\\setup.py'"'"'; __file__='"'"'c:\\users\\public\\documents\\wondershare\\creatortemp\\pip-install-orbh2p\\psutil\\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\public\documents\wondershare\creatortemp\pip-record-58j8zq\install-record.txt' --single-version-externally-managed --compile Check the logs for full command output.

enter image description here

I've already installed Microsoft Visual C++ Compiler for Python 2.7

https://www.microsoft.com/en-us/download/confirmation.aspx?id=44266

It looks like a missing #include <errno.h> somewhere. Is that include somehow on a conditional branch that is not included for pypy?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM