0

我正在使用 python 3.8.6 但由于某种原因它无法为 netifaces 构建一个轮子

错误:

C:\Users\cuerv>pip install --upgrade netifaces 收集 netifaces 使用缓存的 netifaces-0.10.9.tar.gz (28 kB) 为收集的包构建轮子:netifaces 为 netifaces 构建轮子 (setup.py) ... 错误错误:命令出错,退出状态为 1:命令:'c:\users\cuerv\downloads\my code\imports\python 3.8.6\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\cuerv\AppData\Local\Temp\pip-install-femvpx3w\netifaces_673ef3fc78424548962ff6e3f9ac8b17\setup.py'"'"'; file ='"'"'C:\Users\cuerv\AppData\Local\Temp\pip-install-femvpx3w\netifaces_673ef3fc78424548962ff6e3f9ac8b17\setup.py'"'"';f=getattr(tokenize, '"'"'open' "'"',, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\cuerv\AppData\Local\Temp\pip-wheel-qxm_uil5' cwd: C:\Users\cuerv\AppData\Local \Temp\pip-install-femvpx3w\netifaces_673ef3fc78424548962ff6e3f9ac8b17
完整输出(5 行):运行 bdist_wheel 运行 build 运行 build_ext 构建“netifaces”扩展错误:需要 Microsoft Visual C++ 14.0。使用“Visual Studio 构建工具”获取它:https ://visualstudio.microsoft.com/downloads/

错误:为 netifaces 构建轮子失败 为 netifaces 运行 setup.py clean 无法构建 netifaces 安装收集的包:netifaces 为 netifaces 运行 setup.py install ... 错误错误:命令出错,退出状态为 1:命令:'c:\ users\cuerv\downloads\my code\imports\python 3.8.6\python.exe' -u -c 'import sys,setuptools,tokenize;sys.argv[0] = '"'"'C:\Users\cuerv\AppData\Local\Temp\pip-install-femvpx3w\netifaces_673ef3fc78424548962ff6e3f9ac8b17\setup.py'"'"'; file ='"'"'C:\Users\cuerv\AppData\Local\Temp\pip-install-femvpx3w\netifaces_673ef3fc78424548962ff6e3f9ac8b17\setup.py'"'"';f=getattr(tokenize, '"'"'open' "'"', 打开)(文件);, '"'"'exec'"'"'))' 安装 --record 'C:\Users\cuerv\AppData\Local\Temp\pip-record-b4lmtpzg\install-record.txt' --single-version -externally-managed --compile --install-headers 'c:\users\cuerv\downloads\my code\imports\python 3.8.6\Include\netifaces' cwd: C:\Users\cuerv\AppData\Local\Temp \pip-install-femvpx3w\netifaces_673ef3fc78424548962ff6e3f9ac8b17
完整输出(5 行):运行 install running build running build_ext building 'netifaces' 扩展错误:需要 Microsoft Visual C++ 14.0。使用“Visual Studio 构建工具”获取它:https ://visualstudio.microsoft.com/downloads/ ---------------------------------------- 错误:命令出错,退出状态为 1: 'c:\users\cuerv\downloads\my code\imports\python 3.8.6\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\Users\cuerv\AppData\Local\Temp\pip-install-femvpx3w\netifaces_673ef3fc78424548962ff6e3f9ac8b17\setup.py'"'"'; file ='"'"'C:\Users\cuerv\AppData\Local\Temp\pip-install-femvpx3w\netifaces_673ef3fc78424548962ff6e3f9ac8b17\setup.py'"'"';f=getattr(tokenize, '"'"'open' "'"', open)( file );code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"'); f.close();, '"'"'exec'"'"'))' 安装 --record 'C:\Users\cuerv\AppData\Local\Temp\pip-record-b4lmtpzg\install-record.txt' --single-version -externally-managed --compile --install-headers 'c:\users\cuerv\downloads\my code\imports\python 3.8.6\Include\netifaces' 检查日志以获取完整的命令输出。

4

1 回答 1

1

相关行是这样的:

Complete output (5 lines): 
running install running build running build_ext building 'netifaces' extension error: Microsoft Visual C++ 14.0 is required. 
Get it with "Build Tools for Visual Studio": https://visualstudio.microsoft.com/downloads/ 

它告诉您要完成安装,您需要获取它提到的工具并安装它们。该软件包正在尝试在安装期间运行编译,它需要这些工具

于 2020-12-24T18:32:40.830 回答