netifaces Library installation failed
I follow the official website tutorial to install this library on the system,but it always prompts the same error. Error:
C:\Windows\system32>python -m pip install netifaces
Collecting netifaces
Using cached netifaces-0.10.9.tar.gz (28 kB)
Using legacy 'setup.py install' for netifaces, since package 'wheel' is not installed.
Installing collected packages: netifaces
Running setup.py install for netifaces ... error
ERROR: Command errored out with exit status 1:
command: 'C:\Python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\pc\\AppData\\Local\\Temp\\pip-install-kdw643qb\\netifaces\\setup.py'"'"'; __file__='"'"'C:\\Users\\pc\\AppData\\Local\\Temp\\pip-install-kdw643qb\\netifaces\\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\pc\AppData\Local\Temp\pip-record-gp3of64l\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Python38\Include\netifaces'
cwd: C:\Users\pc\AppData\Local\Temp\pip-install-kdw643qb\netifaces\
Complete output (11 lines):
running install
running build
running build_ext
building 'netifaces' extension
creating build
creating build\temp.win-amd64-3.8
creating build\temp.win-amd64-3.8\Release
D:\Visual Studio 2019\VC\Tools\MSVC\14.28.29333\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -DWIN32=1 -DNETIFACES_VERSION=0.10.9 -IC:\Python38\include -IC:\Python38\include "-ID:\Visual Studio 2019\VC\Tools\MSVC\14.28.29333\ATLMFC\include" "-ID:\Visual Studio 2019\VC\Tools\MSVC\14.28.29333\include" /Tcnetifaces.c /Fobuild\temp.win-amd64-3.8\Release\netifaces.obj
netifaces.c
C:\Python38\include\pyconfig.h(59): fatal error C1083: 无法打开包括文件: “io.h”: No such file or directory
error: command 'D:\\Visual Studio 2019\\VC\\Tools\\MSVC\\14.28.29333\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Python38\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\pc\\AppData\\Local\\Temp\\pip-install-kdw643qb\\netifaces\\setup.py'"'"'; __file__='"'"'C:\\Users\\pc\\AppData\\Local\\Temp\\pip-install-kdw643qb\\netifaces\\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\pc\AppData\Local\Temp\pip-record-gp3of64l\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Python38\Include\netifaces' Check the logs for full command output.
I hope someone can help me solve my problem. Thank you very much.
Asked by roslixun on 2020-11-28 01:42:05 UTC
Comments
I'm not sure where your build error is manifesting from. netifaces is installed as part of the Noetic or Foxy install on Windows (http://aka.ms/ros/setup_ros1): Requirement already satisfied: netifaces in c:\opt\ros\noetic\x64\lib\site-packages (0.10.9)
Asked by OoeyGUI on 2020-11-30 12:31:33 UTC