首页 > 其他分享> > Exception: No supported Visual Studio can be found. Supported versions are: 16.0 (2019), 15.0 (2017)
Exception: No supported Visual Studio can be found. Supported versions are: 16.0 (2019), 15.0 (2017)
作者:互联网
在windows上编译webrtc时可能出现如下错误:
Exception: No supported Visual Studio can be found. Supported versions are: 16.0 (2019), 15.0 (2017).
在上面也有提示
File "C:/webrtc/src/build/vs_toolchain.py", line 174, in GetVisualStudioVersion
' Supported versions are: %s.' % supported_versions_str)
这是由于python脚本在找vs的安装路径出错了,默认是按照C盘来查找,但是如果vs2019不是安装在C盘,那就得修改vs_toolchain.py这个文件,路径src/build,原来的代码如下,大概是163行:
path = os.path.expandvars('%ProgramFiles(x86)%' +
'/Microsoft Visual Studio/%s' % version)
if path and any(
os.path.exists(os.path.join(path, edition))
for edition in ('Enterprise', 'Professional', 'Community', 'Preview',
'BuildTools')):
available_versions.append(version)
直接修改为vs的路径,我的安装vs2019安装在D盘
path = os.path.expandvars('D:/Program Files (x86)/Microsoft Visual Studio/%s' % version)
我的修改:
以后安装vs, 还是放C盘吧,免得各种编译问题,太麻烦了。
标签:15.0,Exception,versions,Supported,Visual,vs,Studio,path,os 来源: https://blog.51cto.com/u_12570763/3033957